mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Kernel: Prevent regular users from accessing other processes' threads
This commit is contained in:
parent
2477409680
commit
bbe40ae632
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue