mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernel: Fix usermode verification in ptrace with PT_SETREGS
When doing PT_SETREGS, we want to verify that the debugged thread is executing in usermode. b2f7ccf refactored things and flipped the relevant check around, which broke things that use PT_SETREGS (for example, stepping over breakpoints with sdb).
This commit is contained in:
parent
85ca19ffd5
commit
8fce807b10
Notes:
sideshowbarker
2024-07-17 05:02:42 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/8fce807b10 Pull-request: https://github.com/SerenityOS/serenity/pull/17296
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ static ErrorOr<FlatPtr> handle_ptrace(Kernel::Syscall::SC_ptrace_params const& p
|
|||
|
||||
auto& peer_saved_registers = peer->get_register_dump_from_stack();
|
||||
// Verify that the saved registers are in usermode context
|
||||
if (peer_saved_registers.previous_mode() == ExecutionMode::User)
|
||||
if (peer_saved_registers.previous_mode() != ExecutionMode::User)
|
||||
return EFAULT;
|
||||
|
||||
tracer->set_regs(regs);
|
||||
|
|
Loading…
Reference in a new issue