浏览代码

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.
Luke Wilde 3 年之前
父节点
当前提交
01af7d1ae1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/Memory/MemoryManager.cpp

+ 1 - 1
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);
         }
     }