ladybird/Kernel/VM
Andreas Kling 6136faa4eb Kernel: Add .unmap_after_init section for code we don't need after init
You can now declare functions with UNMAP_AFTER_INIT and they'll get
segregated into a separate kernel section that gets completely
unmapped at the end of initialization.

This can be used for anything we don't need to call once we've booted
into userspace.

There are two nice things about this mechanism:

- It allows us to free up entire pages of memory for other use.
  (Note that this patch does not actually make use of the freed
  pages yet, but in the future we totally could!)

- It allows us to get rid of obviously dangerous gadgets like
  write-to-CR0 and write-to-CR4 which are very useful for an attacker
  trying to disable SMAP/SMEP/etc.

I've also made sure to include a helpful panic message in case you
hit a kernel crash because of this protection. :^)
2021-02-19 20:23:05 +01:00
..
AllocationStrategy.h Kernel: Merge PurgeableVMObject into AnonymousVMObject 2021-01-01 23:43:44 +01:00
AnonymousVMObject.cpp Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...) 2021-02-08 18:08:55 +01:00
AnonymousVMObject.h Kernel: Remove a handful of unused things in VM/ directory 2021-02-11 22:02:39 +01:00
ContiguousVMObject.cpp Kernel: Remove a handful of unused things in VM/ directory 2021-02-11 22:02:39 +01:00
ContiguousVMObject.h Kernel: Allow specifying a physical alignment when allocating 2021-01-28 18:52:59 +01:00
InodeVMObject.cpp Kernel: Assert if rounding-up-to-page-size would wrap around to 0 2021-02-14 10:01:50 +01:00
InodeVMObject.h Kernel: Remove the limited use of AK::TypeTraits we had in the kernel 2021-01-01 15:32:44 +01:00
MappedROM.h Kernel: Fix various forward declarations 2020-09-12 13:46:15 +02:00
MemoryManager.cpp Kernel: Add .unmap_after_init section for code we don't need after init 2021-02-19 20:23:05 +01:00
MemoryManager.h Kernel: Add .unmap_after_init section for code we don't need after init 2021-02-19 20:23:05 +01:00
PageDirectory.cpp Kernel: Remove a handful of unused things in VM/ directory 2021-02-11 22:02:39 +01:00
PageDirectory.h Kernel: Factor address space management out of the Process class 2021-02-08 18:27:28 +01:00
PageFaultResponse.h Kernel: Merge PurgeableVMObject into AnonymousVMObject 2021-01-01 23:43:44 +01:00
PhysicalPage.cpp Kernel: Remove MM_DEBUG debug spam code 2021-01-11 22:09:40 +01:00
PhysicalPage.h Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
PhysicalRegion.cpp Kernel: Allow specifying a physical alignment when allocating 2021-01-28 18:52:59 +01:00
PhysicalRegion.h Kernel: Allow specifying a physical alignment when allocating 2021-01-28 18:52:59 +01:00
PrivateInodeVMObject.cpp Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
PrivateInodeVMObject.h Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
ProcessPagingScope.cpp Kernel: Turn Thread::current and Process::current into functions 2020-07-01 12:07:01 +02:00
ProcessPagingScope.h Kernel: Move ProcessPagingScope to its own files 2020-03-01 15:38:09 +01:00
PurgeablePageRanges.cpp Kernel: Oops, add missing #include to fix ENABLE_ALL_THE_DEBUG_MACROS 2021-02-11 22:15:55 +01:00
PurgeablePageRanges.h Kernel: Remove a handful of unused things in VM/ directory 2021-02-11 22:02:39 +01:00
RangeAllocator.cpp Kernel: Make MAP_RANDOMIZED honor alignment requests 2021-02-12 19:15:59 +01:00
RangeAllocator.h Kernel: Convert klog() to dmesgln() in RangeAllocator 2021-02-12 16:24:40 +01:00
Region.cpp Kernel: Assert if rounding-up-to-page-size would wrap around to 0 2021-02-14 10:01:50 +01:00
Region.h Kernel: Make the Region constructor private 2021-02-14 01:39:04 +01:00
SharedInodeVMObject.cpp Kernel: Remove a handful of unused things in VM/ directory 2021-02-11 22:02:39 +01:00
SharedInodeVMObject.h Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
Space.cpp Kernel: Assert if rounding-up-to-page-size would wrap around to 0 2021-02-14 10:01:50 +01:00
Space.h Kernel: Make the space lock a RecursiveSpinLock 2021-02-08 22:28:48 +01:00
TypedMapping.h Kernel: Assert if rounding-up-to-page-size would wrap around to 0 2021-02-14 10:01:50 +01:00
VMObject.cpp Kernel: Remove a handful of unused things in VM/ directory 2021-02-11 22:02:39 +01:00
VMObject.h Kernel: Some futex improvements 2021-01-17 20:30:31 +01:00