From 5ce9382e982648fc961501d4a059789ab1f8c31c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 19 Jan 2020 08:50:55 +0100 Subject: [PATCH] Kernel: Only require "stdio" pledge for sending signals to self This should match what OpenBSD does. Sending a signal to yourself seems basically harmless. --- Kernel/Process.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)