From 2a7af0eacf3cb569156ad2d1da4e1c9085807bd2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 30 Jan 2019 20:18:50 +0100 Subject: Kernel: Don't try to dump invalid code memory in page fault handler. --- Kernel/i386.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Kernel') diff --git a/Kernel/i386.cpp b/Kernel/i386.cpp index 5b7268fc85..172e0132a6 100644 --- a/Kernel/i386.cpp +++ b/Kernel/i386.cpp @@ -263,8 +263,9 @@ void exception_14_handler(RegisterDumpWithExceptionCode& regs) dbgprintf("eax=%x ebx=%x ecx=%x edx=%x\n", regs.eax, regs.ebx, regs.ecx, regs.edx); dbgprintf("ebp=%x esp=%x esi=%x edi=%x\n", regs.ebp, esp, regs.esi, regs.edi); - byte* codeptr = (byte*)regs.eip; - dbgprintf("code: %b %b %b %b %b %b %b %b\n", + if (current->validate_read((void*)regs.eip, 8)) { + byte* codeptr = (byte*)regs.eip; + dbgprintf("code: %b %b %b %b %b %b %b %b\n", codeptr[0], codeptr[1], codeptr[2], @@ -273,7 +274,8 @@ void exception_14_handler(RegisterDumpWithExceptionCode& regs) codeptr[5], codeptr[6], codeptr[7] - ); + ); + } }; if (current->isRing0()) { -- cgit v1.2.3