mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +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)
|
if (pid_or_tid != 0)
|
||||||
peer = Thread::from_tid(pid_or_tid);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case Syscall::SchedulerParametersMode::Process: {
|
case Syscall::SchedulerParametersMode::Process: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue