浏览代码

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.
Andrew Kaster 4 年之前
父节点
当前提交
70518e69f4
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Kernel/Syscalls/execve.cpp

+ 1 - 0
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.