|
|
|
|
|
by beefhash
2934 days ago
|
|
pledge(2) on OpenBSD is used to drop the privileges of a process. Processes are meant to call pledge(2) to drop their own privileges. The way pledge(2) works is that the system calls of that process get limited. If a process calls a system call outside the allowed range after calling pledge(2), it gets killed. Starting with OpenBSD 6.3, it is also possible to configure pledge to make the kernel return ENOSYS instead of killing the process when violating the pledge. For example: /* Only the system calls required
* for the standard I/O library and
* for accessing /dev/tty are allowed
* by the kernel from this point on.
*/
pledge("stdio tty", NULL);
The second argument is the execpromises, i.e., the pledges enforced for child processes. This does not need to be specified if you pledge in a way that does not include any way of spawning a new process.What's new in the slides linked is unveil(2). This seems to be used to limit the exact paths a process can access and with what access flags (rwxc). |
|
[1] http://packetfactory.openwall.net/projects/stephanie/index.h...