ladybird/Kernel/VM
Andreas Kling 3dcec260ed Kernel: Validate the full range of user memory passed to syscalls
We now validate the full range of userspace memory passed into syscalls
instead of just checking that the first and last byte of the memory are
in process-owned regions.

This fixes an issue where it was possible to avoid rejection of invalid
addresses that sat between two valid ones, simply by passing a valid
address and a size large enough to put the end of the range at another
valid address.

I added a little test utility that tries to provoke EFAULT in various
ways to help verify this. I'm sure we can think of more ways to test
this but it's at least a start. :^)

Thanks to mozjag for pointing out that this code was still lacking!

Incidentally this also makes backtraces work again.

Fixes #989.
2020-01-02 02:17:12 +01:00
..
AnonymousVMObject.cpp Kernel: Use a FixedArray for VMObject::m_physical_pages 2019-08-07 20:12:50 +02:00
AnonymousVMObject.h Kernel: Start implementing purgeable memory support 2019-12-09 19:12:38 +01:00
InodeVMObject.cpp Kernel: Add a mode flag to sys$purge and allow purging clean inodes 2019-12-29 13:16:53 +01:00
InodeVMObject.h Kernel: Add a mode flag to sys$purge and allow purging clean inodes 2019-12-29 13:16:53 +01:00
MemoryManager.cpp Kernel: Validate the full range of user memory passed to syscalls 2020-01-02 02:17:12 +01:00
MemoryManager.h Kernel: Validate the full range of user memory passed to syscalls 2020-01-02 02:17:12 +01:00
PageDirectory.cpp Kernel: Enable PAE (Physical Address Extension) 2019-12-25 13:35:57 +01:00
PageDirectory.h Kernel: Enable PAE (Physical Address Extension) 2019-12-25 13:35:57 +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
PurgeableVMObject.cpp Kernel: When physical page allocation fails, try to purge something 2019-12-26 11:45:36 +01:00
PurgeableVMObject.h Kernel: When physical page allocation fails, try to purge something 2019-12-26 11:45:36 +01: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: Share code between Region::map() and Region::remap_page() 2020-01-01 19:32:55 +01:00
Region.h Kernel: Share code between Region::map() and Region::remap_page() 2020-01-01 19:32:55 +01:00
VirtualAddress.h Kernel: Add LogStream operator<< for VirtualAddress 2019-08-06 10:28:46 +02:00
VMObject.cpp Kernel: Rename vmo => vmobject everywhere 2019-12-19 19:15:27 +01:00
VMObject.h Kernel: Start implementing purgeable memory support 2019-12-09 19:12:38 +01:00