From 92859f5a286d4a48157d19a3d240b32b7310e5a9 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Wed, 3 Aug 2016 18:46:15 -0500 Subject: [PATCH] Protect the first 64kb of virtual memory with no access permissions by default. --- src/xenia/memory.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index bbf021c66..3e559e188 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -24,8 +24,7 @@ // TODO(benvanik): move xbox.h out #include "xenia/xbox.h" -DEFINE_bool(protect_zero, false, - "Protect the zero page from reads and writes."); +DEFINE_bool(protect_zero, true, "Protect the zero page from reads and writes."); DEFINE_bool(protect_on_release, false, "Protect released memory to prevent accesses."); @@ -172,7 +171,7 @@ bool Memory::Initialize() { heaps_.vE0000000.Initialize(virtual_membase_, 0xE0000000, 0x1FD00000, 4096, &heaps_.physical); - // Take the first page at 0 so we can check for writes. + // Protect the first 64kb of memory. heaps_.v00000000.AllocFixed( 0x00000000, 64 * 1024, 64 * 1024, kMemoryAllocationReserve | kMemoryAllocationCommit,