v3 does not have any mechanism to detect NULL pointers used by accident.

I propose to fill the zero page (0x0-0xfff) with a special POISON_BYTE,
maybe 0x6b. Furthermore, I'd like to make sure passing a NULL pointer
(or something near it) to as a string to printk will be very visible in
the logs.
*(char *)0 = "ERROR NULL POINTER DEREFERENCE!\n";
The C statement above would cause a nice print everytime someone
referenced the first 32 bytes in %s.

Another way to do this is extending the non-NULL check in printk to
cover the whole zero page.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/


--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to