Re:How a computer boots up
by dkersten on Wednesday April 11, 2012 @07:40PM
(#3830210)
Also the C null pointer on modern system is the logical (virtual memory) address which is not necessarily mapped to 0x0 physical address - in fact, to trap the null pointer access, this page would be left unmapped so the OS receives a page fault. This means that before virtual memory is set up (or if a page is mapped for logical address 0x0), 0x0 is a perfectly valid memory location, both for data storage and executing instructions from. Basically, the null pointer "error" is trapped by the OS at a higher level.
[ Parent
| on HN ]
In fact, there's an entire class of kernel exploits where if you know a certain kind of behavior will cause the kernel to dereference 0x0, and that system allows you to mmap the lowest page in your virtual address space, you can take over the machine.
See https://blogs.oracle.com/ksplice/entry/much_ado_about_null_a... and https://blogs.oracle.com/ksplice/entry/much_ado_about_null_e...
(dkersten, I assume you know this, I'm pointing it out for the benefit of others.)