summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-30 20:18:50 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-30 20:18:50 +0100
commit2a7af0eacf3cb569156ad2d1da4e1c9085807bd2 (patch)
tree8c97ce5e59b06fa7b4df469072ca9136df7e3a4d /Kernel
parent3ebbefd916cc4d0d609accf086bebf4b380e00bc (diff)
downloadserenity-2a7af0eacf3cb569156ad2d1da4e1c9085807bd2.zip
Kernel: Don't try to dump invalid code memory in page fault handler.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/i386.cpp8
1 files changed, 5 insertions, 3 deletions
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()) {