]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfsboot: Fix startup crash
authorKristof Provost <kp@FreeBSD.org>
Sun, 5 Aug 2018 11:15:28 +0000 (11:15 +0000)
committerKristof Provost <kp@FreeBSD.org>
Sun, 5 Aug 2018 11:15:28 +0000 (11:15 +0000)
commit5abe8cb6de5fac0d01979060552407a05e66909b
tree7ef1063326fa8f91e888dcb5035459a5538e091a
parent26f3e847c3a1a0b9e7a2258441de0bba6e9a293f
zfsboot: Fix startup crash

On a FreeNAS mini XL, with geli encrypted drives the loader crashed in
geli_read().

When we iterate over the list of disks and allocate the zfsdsk structures we
don’t zero out the gdev pointer. In one case that resulted in geli_read()
(called on the bogus pointer) dividing by zero.

Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is
initialised to NULL. As a side benefit it gets rid of one #ifdef
LOADER_GELI_SUPPORT.
stand/i386/zfsboot/zfsboot.c