1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:28:11 +00:00

Kernel: Release scheduler_lock in ptrace once we know tracee is stopped

This fixes a kernel crash that occured when calling ptrace with PT_PEEK
on non paged-in memory.
The crash occurred because we were holding the scheduler lock while
trying to read from the disk's block device, which we do not allow.
Fixes #4740
This commit is contained in:
Itamar 2021-01-02 12:03:28 +02:00 committed by Andreas Kling
parent a50583ade1
commit df5ea97c51

View file

@ -86,6 +86,8 @@ KResultOr<u32> handle_syscall(const Kernel::Syscall::SC_ptrace_params& params, P
if (peer->state() == Thread::State::Running)
return KResult(-EBUSY);
scheduler_lock.unlock();
switch (params.request) {
case PT_CONTINUE:
peer->send_signal(SIGCONT, &caller);