mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 00:19:27 +00:00
Kernel: Prevent regular users from accessing other processes' threads
This commit is contained in:
parent
2477409680
commit
bbe40ae632
|
@ -29,6 +29,10 @@ ErrorOr<NonnullRefPtr<Thread>> Process::get_thread_from_pid_or_tid(pid_t pid_or_
|
|||
if (pid_or_tid != 0)
|
||||
peer = Thread::from_tid(pid_or_tid);
|
||||
|
||||
// Only superuser can access other processes' threads.
|
||||
if (!credentials()->is_superuser() && peer && &peer->process() != this)
|
||||
return EPERM;
|
||||
|
||||
break;
|
||||
}
|
||||
case Syscall::SchedulerParametersMode::Process: {
|
||||
|
|
Loading…
Reference in a new issue