mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
Kernel: No lock validate_user_stack variant, switch to Space as argument
The entire process is not needed, just require the user to pass in the Space. Also provide no_lock variant to use when you already have the VM/Space lock acquired, to avoid unnecessary recursive spinlock acquisitions.
This commit is contained in:
parent
59b6169b51
commit
308396bca1
5 changed files with 16 additions and 7 deletions
|
@ -311,7 +311,7 @@ void page_fault_handler(TrapFrame* trap)
|
|||
};
|
||||
|
||||
VirtualAddress userspace_sp = VirtualAddress { regs.userspace_sp() };
|
||||
if (!faulted_in_kernel && !MM.validate_user_stack(current_thread->process(), userspace_sp)) {
|
||||
if (!faulted_in_kernel && !MM.validate_user_stack(current_thread->process().space(), userspace_sp)) {
|
||||
dbgln("Invalid stack pointer: {}", userspace_sp);
|
||||
handle_crash(regs, "Bad stack on page fault", SIGSTKFLT);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue