Sfoglia il codice sorgente

Kernel: Only require "stdio" pledge for sending signals to self

This should match what OpenBSD does. Sending a signal to yourself seems
basically harmless.
Andreas Kling 5 anni fa
parent
commit
5ce9382e98
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      Kernel/Process.cpp

+ 5 - 1
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)