serenity/Kernel/VM
Andreas Kling 2d1bcce34a Kernel: Fix triple-fault when clicking on SystemServer in SystemMonitor
The fault was happening when retrieving a current backtrace for the
SystemServer process.

To generate a backtrace, we go into the paging scope of the process,
meaning we temporarily switch to using its page directory as our own.

Because kernel VM is allocated on demand, it's possible for a process's
mappings above the 3GB mark to be out-of-date. Normally this just gets
fixed up transparently by the page fault handler (which simply copies
the PDE from the canonical MM.kernel_page_directory() into the current
process.)

However, if the current kernel *stack* is in a piece of memory that
the backtraced process lacks up-to-date PDE's for, we still get a page
fault, but are unable to handle it, since the CPU wants to push to the
stack as part of calling the page fault handler. So we're screwed and
it's a triple-fault.

Fix this by always updating the kernel VM mappings before switching
into a paging scope. In practical terms, this is a 1KB memcpy() that
happens when generating a backtrace, or doing exec().
2019-11-27 12:40:42 +01:00
..
AnonymousVMObject.cpp Kernel: Use a FixedArray for VMObject::m_physical_pages 2019-08-07 20:12:50 +02:00
AnonymousVMObject.h Kernel: Split VMObject into two classes: Anonymous- and InodeVMObject 2019-08-07 18:09:32 +02:00
InodeVMObject.cpp Kernel: Teach Region how to remap itself 2019-11-03 21:11:08 +01:00
InodeVMObject.h Kernel: Split VMObject into two classes: Anonymous- and InodeVMObject 2019-08-07 18:09:32 +02:00
MemoryManager.cpp Kernel: Fix triple-fault when clicking on SystemServer in SystemMonitor 2019-11-27 12:40:42 +01:00
MemoryManager.h Revert "Kernel: Move Kernel mapping to 0xc0000000" 2019-11-23 17:27:09 +01:00
PageDirectory.cpp Kernel: Fix triple-fault when clicking on SystemServer in SystemMonitor 2019-11-27 12:40:42 +01:00
PageDirectory.h Kernel: Fix triple-fault when clicking on SystemServer in SystemMonitor 2019-11-27 12:40:42 +01:00
PhysicalAddress.h Kernel: Add LogStream operator<< for PhysicalAddress 2019-09-15 20:47:49 +02:00
PhysicalPage.cpp Kernel: Move kmalloc() into a Kernel/Heap/ directory 2019-09-16 09:01:44 +02:00
PhysicalPage.h Kernel: Add a simple slab allocator for small allocations 2019-09-16 10:33:27 +02:00
PhysicalRegion.cpp Kernel: Fix returning pages to regions >= 2GB 2019-09-17 09:27:23 +02:00
PhysicalRegion.h Kernel: Move PhysicalAddress.h into VM/ 2019-07-09 15:04:45 +02:00
RangeAllocator.cpp Kernel: Make it possible to turn off VM guard pages at compile time 2019-09-30 17:22:16 +02:00
RangeAllocator.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
Region.cpp Kernel: Make syscall counters and page fault counters per-thread 2019-11-26 21:37:38 +01:00
Region.h Kernel: Mark mmap()-created regions with a special bit 2019-11-24 12:26:21 +01:00
VirtualAddress.h Kernel: Add LogStream operator<< for VirtualAddress 2019-08-06 10:28:46 +02:00
VMObject.cpp Kernel: Use a FixedArray for VMObject::m_physical_pages 2019-08-07 20:12:50 +02:00
VMObject.h Kernel: Move page fault handling from MemoryManager to Region 2019-11-04 00:47:03 +01:00