summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-29 18:50:27 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-29 18:56:34 +0100
commitd0c5979d96f4e9bde692e14c3507f1e6cc21d5a2 (patch)
treebc090f6a378387dfd99b33ac359f81cd4fab3ef3 /Kernel/Process.h
parentdf30b3e54c96f83707bd4fcf6ae158888411efe7 (diff)
downloadserenity-d0c5979d96f4e9bde692e14c3507f1e6cc21d5a2.zip
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.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index 612bd6317d..373abe8090 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -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,