diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-05-26 13:49:35 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-26 14:35:10 +0200 |
commit | cddaeb43d31304a5cb7ccdf8cf08a2bdbfff84cf (patch) | |
tree | f19eecbe0440907852bce25917b1c1531db0d5a3 /Kernel | |
parent | 839ae82d66a60926c616b023aba4080f999931f9 (diff) | |
download | serenity-cddaeb43d31304a5cb7ccdf8cf08a2bdbfff84cf.zip |
Kernel: Introduce "sigaction" pledge
You now have to pledge "sigaction" to change signal handlers/dispositions. This
is to prevent malicious code from messing with assertions (and segmentation
faults), which are normally expected to instantly terminate the process but can
do other things if you change signal disposition for them.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 2 | ||||
-rw-r--r-- | Kernel/Process.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index fa3599dec5..20921c3e2b 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -2711,7 +2711,7 @@ int Process::sys$sigpending(sigset_t* set) int Process::sys$sigaction(int signum, const sigaction* act, sigaction* old_act) { - REQUIRE_PROMISE(stdio); + REQUIRE_PROMISE(sigaction); if (signum < 1 || signum >= 32 || signum == SIGKILL || signum == SIGSTOP) return -EINVAL; if (!validate_read_typed(act)) diff --git a/Kernel/Process.h b/Kernel/Process.h index f24789fbdc..fa52440707 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -72,6 +72,7 @@ extern VirtualAddress g_return_to_ring3_from_signal_trampoline; __ENUMERATE_PLEDGE_PROMISE(video) \ __ENUMERATE_PLEDGE_PROMISE(accept) \ __ENUMERATE_PLEDGE_PROMISE(settime) \ + __ENUMERATE_PLEDGE_PROMISE(sigaction) \ __ENUMERATE_PLEDGE_PROMISE(shared_buffer) enum class Pledge : u32 { |