NetBSD/usr.sbin/installboot
kamil 49b4c5f864 Fix integer overflow in installboot(8)
Add a sanity check of the disk_buf first three bytes. The original code on
a disk with nul bytes was causing integer overflow and thus calling the
memcmp(3) functin in is_zero() with enormous length.

Verity that the 0th byte is JMP, 1th a signed byte >=9 to prevent overflow
and 2th byte NOP.

Add a comment explaining the check.

Detected with MKSANITIZER and ASan.
2018-06-23 14:15:57 +00:00
..
arch Fix integer overflow in installboot(8) 2018-06-23 14:15:57 +00:00
bbinfo.c
ext2fs.c fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB() 2013-06-23 02:06:04 +00:00
ffs.c fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB() 2013-06-23 02:06:04 +00:00
fstypes.c Remove if defined(__RCSID) around __RCSID() macro. 2010-01-14 16:27:49 +00:00
installboot.8 Remove superfluous Tn macros. 2017-08-15 21:21:18 +00:00
installboot.c Handle getfsspecname errors. 2015-07-25 10:37:22 +00:00
installboot.h Rename NetBSD/hp700 to NetBSD/hppa. 2014-02-24 07:23:38 +00:00
machines.c Rename NetBSD/hp700 to NetBSD/hppa. 2014-02-24 07:23:38 +00:00
Makefile Disable a couple of warnings until further investigation. 2017-01-11 12:19:43 +00:00
sum.c Remove if defined(__RCSID) around __RCSID() macro. 2010-01-14 16:27:49 +00:00