mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-02 16:25:34 +03:00
Kernel: Prevent regular users from accessing other processes' threads
This commit is contained in:
parent
2477409680
commit
bbe40ae632
Notes:
sideshowbarker
2024-07-17 05:04:09 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/bbe40ae632 Pull-request: https://github.com/SerenityOS/serenity/pull/14672 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/timschumi
@ -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 New Issue
Block a user