summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-19 08:50:55 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-19 08:50:55 +0100
commit5ce9382e982648fc961501d4a059789ab1f8c31c (patch)
treeaba727fa1c093f3107038373f683264a798feda1 /Kernel
parentead1273632f36c52c6496b992d9aa74dbc18bc75 (diff)
downloadserenity-5ce9382e982648fc961501d4a059789ab1f8c31c.zip
Kernel: Only require "stdio" pledge for sending signals to self
This should match what OpenBSD does. Sending a signal to yourself seems basically harmless.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Process.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 8ae036b394..f69bcf4b51 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -2128,7 +2128,11 @@ KResult Process::do_killpg(pid_t pgrp, int signal)
int Process::sys$kill(pid_t pid, int signal)
{
- REQUIRE_PROMISE(proc);
+ if (pid == m_pid)
+ REQUIRE_PROMISE(stdio);
+ else
+ REQUIRE_PROMISE(proc);
+
if (signal < 0 || signal >= 32)
return -EINVAL;
if (pid <= 0)