ladybird/Kernel/VM
Andreas Kling f7b394e9a1 Kernel: Assert that copy_to/from_user() are called with user addresses
This will panic the kernel immediately if these functions are misused
so we can catch it and fix the misuse.

This patch fixes a couple of misuses:

    - create_signal_trampolines() writes to a user-accessible page
      above the 3GB address mark. We should really get rid of this
      page but that's a whole other thing.

    - CoW faults need to use copy_from_user rather than copy_to_user
      since it's the *source* pointer that points to user memory.

    - Inode faults need to use memcpy rather than copy_to_user since
      we're copying a kernel stack buffer into a quickmapped page.

This should make the copy_to/from_user() functions slightly less useful
for exploitation. Before this, they were essentially just glorified
memcpy() with SMAP disabled. :^)
2020-01-19 09:18:55 +01:00
..
AnonymousVMObject.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
AnonymousVMObject.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
InodeVMObject.cpp Kernel: Enforce W^X between sys$mmap() and sys$execve() 2020-01-18 23:40:12 +01:00
InodeVMObject.h Kernel: Enforce W^X between sys$mmap() and sys$execve() 2020-01-18 23:40:12 +01:00
MemoryManager.cpp Kernel: Move all CPU feature initialization into cpu_setup() 2020-01-18 10:11:29 +01:00
MemoryManager.h Kernel: Assert that copy_to/from_user() are called with user addresses 2020-01-19 09:18:55 +01:00
PageDirectory.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PageDirectory.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PhysicalAddress.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PhysicalPage.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PhysicalPage.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PhysicalRegion.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PhysicalRegion.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PurgeableVMObject.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PurgeableVMObject.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
RangeAllocator.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
RangeAllocator.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Region.cpp Kernel: Assert that copy_to/from_user() are called with user addresses 2020-01-19 09:18:55 +01:00
Region.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
VirtualAddress.h Kernel: Assert that copy_to/from_user() are called with user addresses 2020-01-19 09:18:55 +01:00
VMObject.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
VMObject.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00