mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
Kernel: Release ptrace lock in exec before stopping due to PT_TRACE_ME
If we have a tracer process waiting for us to exec, we need to release the ptrace lock before stopping ourselves, since otherwise the tracer will block forever on the lock. Fixes #5409.
This commit is contained in:
parent
37d8faf1b4
commit
6e83be67b8
Notes:
sideshowbarker
2024-07-18 22:09:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6e83be67b8c
@ -584,8 +584,11 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
|
||||
return make_stack_result.error();
|
||||
u32 new_userspace_esp = make_stack_result.value();
|
||||
|
||||
if (wait_for_tracer_at_next_execve())
|
||||
if (wait_for_tracer_at_next_execve()) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
// 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…
Reference in New Issue
Block a user