Kernel: Don't use {:p} when printing out invalid userspace stack pointer

`userspace_esp` is a virtual address and thus using `{:p}` on it is
invalid and will cause an assertion failure.

I ran into this while testing #9772.
This commit is contained in:
Luke Wilde 2021-09-03 04:45:01 +01:00 committed by Andreas Kling
parent 2b13c9942d
commit 01af7d1ae1
Notes: sideshowbarker 2024-07-18 04:50:11 +09:00

View file

@ -646,7 +646,7 @@ void MemoryManager::validate_syscall_preconditions(AddressSpace& space, Register
{
VirtualAddress userspace_sp = VirtualAddress { regs.userspace_sp() };
if (!MM.validate_user_stack_no_lock(space, userspace_sp)) {
dbgln("Invalid stack pointer: {:p}", userspace_sp);
dbgln("Invalid stack pointer: {}", userspace_sp);
unlock_and_handle_crash("Bad stack on syscall entry", SIGSTKFLT);
}
}