Kernel: Don't allow to kill kernel processes
The protection was only for SIGKILL before.
This commit is contained in:
parent
072c264a04
commit
6efcc2fc99
Notes:
sideshowbarker
2024-07-18 19:11:56 +09:00
Author: https://github.com/sppmacd Commit: https://github.com/SerenityOS/serenity/commit/6efcc2fc99b Pull-request: https://github.com/SerenityOS/serenity/pull/6583 Issue: https://github.com/SerenityOS/serenity/issues/6582
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue