mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +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
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();
|
auto& peer_saved_registers = peer->get_register_dump_from_stack();
|
||||||
// Verify that the saved registers are in usermode context
|
// 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;
|
return EFAULT;
|
||||||
|
|
||||||
tracer->set_regs(regs);
|
tracer->set_regs(regs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue