Kernel: Add "prot_exec" pledge promise and require it for PROT_EXEC

This prevents sys$mmap() and sys$mprotect() from creating executable
memory mappings in pledged programs that don't have this promise.

Note that the dynamic loader runs before pledging happens, so it's
unaffected by this.
This commit is contained in:
Andreas Kling 2021-01-29 18:50:27 +01:00
commit d0c5979d96
Notes: sideshowbarker 2024-07-18 22:46:07 +09:00
3 changed files with 11 additions and 1 deletions

View file

@ -81,7 +81,8 @@ extern VirtualAddress g_return_to_ring3_from_signal_trampoline;
__ENUMERATE_PLEDGE_PROMISE(accept) \
__ENUMERATE_PLEDGE_PROMISE(settime) \
__ENUMERATE_PLEDGE_PROMISE(sigaction) \
__ENUMERATE_PLEDGE_PROMISE(setkeymap)
__ENUMERATE_PLEDGE_PROMISE(setkeymap) \
__ENUMERATE_PLEDGE_PROMISE(prot_exec)
enum class Pledge : u32 {
#define __ENUMERATE_PLEDGE_PROMISE(x) x,