Kernel: Prevent regular users from accessing other processes' threads

This commit is contained in:
kleines Filmröllchen 2022-07-24 18:01:57 +02:00 committed by Linus Groh
parent 2477409680
commit bbe40ae632

View file

@ -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: {