From 6efcc2fc99b513f4d766fbba0599549fa44023c3 Mon Sep 17 00:00:00 2001 From: Maciej Zygmanowski Date: Fri, 23 Apr 2021 12:07:55 +0200 Subject: [PATCH] Kernel: Don't allow to kill kernel processes The protection was only for SIGKILL before. --- Kernel/Syscalls/kill.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Syscalls/kill.cpp b/Kernel/Syscalls/kill.cpp index 0d6ce96abc5..6ce69b72175 100644 --- a/Kernel/Syscalls/kill.cpp +++ b/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)