5 ms·
Which x86 kernel maps something at 0? In Windows and Linux, the low part of virtual address space is reserved for userspace. In fact, Linux had several privile
by qb45 11y ago
Which x86 kernel maps something at 0? In Windows and Linux, the low part of virtual address space is reserved for userspace.
In fact, Linux had several privilege escalation bugs which involved putting something at 0 and executing a buggy syscall which loaded this thing due to NULL dereference and believed it's some legit internal kernel data.
- 0x0 11y agoWhich was probably the reason why "mmap_min_addr" was added :) https://wiki.debian.org/mmap_min_addr https://wiki.debian.org/mmap_min_addr
- makomk 11y agoMappings at zero are used by legacy code like 16-bit Windows applications, if I remember correctly.
- jevinskie 11y agoOS X and iOS map in __TEXT,__PAGEZERO to 0x0.* Of course, it is mapped without any protection levels so it isn't of much use except for catching most nullptr dereferences (just 4 GB of protection on x86_64!). * Well, this is implemented by the default system toolchain. You'r particular toolchain can opt out of this behavior if they want to.