Browse Source

Kernel: Don't allow to kill kernel processes

The protection was only for SIGKILL before.
Maciej Zygmanowski 4 năm trước cách đây
mục cha
commit
6efcc2fc99
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      Kernel/Syscalls/kill.cpp

+ 2 - 2
Kernel/Syscalls/kill.cpp

@@ -14,8 +14,8 @@ KResult Process::do_kill(Process& process, int signal)
     // FIXME: Should setuid processes have some special treatment here?
     if (!is_superuser() && euid() != process.uid() && uid() != process.uid())
         return EPERM;
-    if (process.is_kernel_process() && signal == SIGKILL) {
-        dbgln("Aattempted to send SIGKILL to kernel process {} ({})", process.name(), process.pid());
+    if (process.is_kernel_process()) {
+        dbgln("Attempted to send signal {} to kernel process {} ({})", signal, process.name(), process.pid());
         return EPERM;
     }
     if (signal != 0)