mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
Kernel: Only unlock Mutex once in execve when PT_TRACE_ME is enabled
Fixes a regression introduced in 70518e6
. Fixes #9704.
This commit is contained in:
parent
33d7fdca28
commit
fcdd7aa990
1 changed files with 4 additions and 1 deletions
|
@ -628,8 +628,11 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
|
|||
// Make sure we release the ptrace lock here or the tracer will block forever.
|
||||
ptrace_locker.unlock();
|
||||
Thread::current()->send_urgent_signal_to_self(SIGSTOP);
|
||||
} else {
|
||||
// Unlock regardless before disabling interrupts.
|
||||
// Ensure we always unlock after checking ptrace status to avoid TOCTOU ptrace issues
|
||||
ptrace_locker.unlock();
|
||||
}
|
||||
ptrace_locker.unlock(); // unlock before disabling interrupts as well
|
||||
|
||||
// We enter a critical section here because we don't want to get interrupted between do_exec()
|
||||
// and Processor::assume_context() or the next context switch.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue