mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +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
Notes:
sideshowbarker
2024-07-18 04:58:43 +09:00
Author: https://github.com/ADKaster
Commit: fcdd7aa990
Pull-request: https://github.com/SerenityOS/serenity/pull/9715
Issue: https://github.com/SerenityOS/serenity/issues/9704
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