Fun with NULL pointers, part 2
Fun with NULL pointers, part 2
Posted Jul 22, 2009 13:25 UTC (Wed) by dgm (subscriber, #49227)In reply to: Fun with NULL pointers, part 2 by epa
Parent article: Fun with NULL pointers, part 2
Looks like a variation of the "end to end principle" (http://en.wikipedia.org/wiki/End-to-end_principle). No matter that callers check for NULL, the callee has still to check it, again.
Also, as someone has pointed out, NULL is just *one* invalid pointer value (even if a common one). The kernel should better be testing to prevent pointers to user space, except when needed.
I don't know enough Linux internals. Should it be possible to make those tests with some memory protection trickery?
