From 01af7d1ae16774057e3afdd34eafce07113cf3bd Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Fri, 3 Sep 2021 04:45:01 +0100 Subject: [PATCH] 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. --- Kernel/Memory/MemoryManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Memory/MemoryManager.cpp b/Kernel/Memory/MemoryManager.cpp index 8fb08caa67..3f65dd290c 100644 --- a/Kernel/Memory/MemoryManager.cpp +++ b/Kernel/Memory/MemoryManager.cpp @@ -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); } }