summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/execve.cpp
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-08-22 21:50:56 -0600
committerAndreas Kling <kling@serenityos.org>2021-08-28 20:53:38 +0200
commit70518e69f40869b2fb6cbf69e33cbd24ecfa6d61 (patch)
treebfd84e35e6a88ddb8a7777ec15fd210df675795f /Kernel/Syscalls/execve.cpp
parent8e70b8521563778489e26de084f5994d95c3086a (diff)
downloadserenity-70518e69f40869b2fb6cbf69e33cbd24ecfa6d61.zip
Kernel: Unlock ptrace lock before entering a critical section in execve
While it might not be as bad to release a mutex while interrupts are disabled as it is to acquire one, we don't want to mess with that.
Diffstat (limited to 'Kernel/Syscalls/execve.cpp')
-rw-r--r--Kernel/Syscalls/execve.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp
index de55afc2f0..7cb86ffab3 100644
--- a/Kernel/Syscalls/execve.cpp
+++ b/Kernel/Syscalls/execve.cpp
@@ -626,6 +626,7 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
ptrace_locker.unlock();
Thread::current()->send_urgent_signal_to_self(SIGSTOP);
}
+ 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.