mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 08:52:54 +00:00
Kernel: More PID/TID typing
This commit is contained in:
parent
7bdf54c837
commit
bee08a4b9f
Notes:
sideshowbarker
2024-07-19 04:06:40 +09:00
Author: https://github.com/BenWiederhake
Commit: bee08a4b9f
Pull-request: https://github.com/SerenityOS/serenity/pull/3057
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bgianfo
21 changed files with 67 additions and 60 deletions
|
@ -43,13 +43,17 @@ KResultOr<u32> handle_syscall(const Kernel::Syscall::SC_ptrace_params& params, P
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
if (params.pid == caller.pid().value())
|
||||
// FIXME: PID/TID BUG
|
||||
// This bug allows to request PT_ATTACH (or anything else) the same process, as
|
||||
// long it is not the main thread. Alternatively, if this is desired, then the
|
||||
// bug is that this prevents PT_ATTACH to the main thread from another thread.
|
||||
if (params.tid == caller.pid().value())
|
||||
return KResult(-EINVAL);
|
||||
|
||||
Thread* peer = nullptr;
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
peer = Thread::from_tid(params.pid);
|
||||
peer = Thread::from_tid(params.tid);
|
||||
}
|
||||
if (!peer)
|
||||
return KResult(-ESRCH);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue