svn commit: r336252 - in head: share/mk stand stand/common stand/efi/loader stand/i386/gptboot stand/i386/gptzfsboot stand/i386/isoboot stand/i386/libi386 stand/i386/loader stand/i386/zfsboot stand...

Warner Losh imp at bsdimp.com
Sat Aug 4 20:30:48 UTC 2018


On Sat, Aug 4, 2018 at 1:57 PM, Kristof Provost <kp at freebsd.org> wrote:

> On 13 Jul 2018, at 19:50, Ian Lepore wrote:
>
> Author: ian
> Date: Fri Jul 13 17:50:25 2018
> New Revision: 336252
> URL: https://svnweb.freebsd.org/changeset/base/336252
>
> Log:
> Extend loader(8) geli support to all architectures and all disk-like
> devices.
>
> This moves the bulk of the geli support from lib386/biosdisk.c into a new
> geli/gelidev.c which implements a devsw-type device whose dv_strategy()
> function handles geli decryption. Support for all arches comes from moving
> the taste-and-attach code to the devopen() function in libsa.
>
> After opening any DEVT_DISK device, devopen() calls the new function
> geli_probe_and_attach(), which will "attach" the geli code to the open_file
> struct by creating a geli_devdesc instance to replace the disk_devdesc
> instance in the open_file. That routes all IO for the device through the
> geli code.
>
> A new public geli_add_key() function is added, to allow
> arch/vendor-specific
> code to add keys obtained from custom hardware or other sources.
>
> With these changes, geli support will be compiled into all variations of
> loader(8) on all arches because the default is WITH_LOADER_GELI.
>
> Relnotes: yes
> Sponsored by: Microchip Technology Inc
> Differential Revision: https://reviews.freebsd.org/D15743
>
> I ran into a crash during startup with a geli encrypted raid-z1 root pool.
>
> I believe this change broke it (although it could have been broken before
> too).
> When we iterate over the list of disks and allocate the zfsdsk structures
> we don’t zero out the gdev pointer. In my case that resulted in a
> geli_read() (called on the bogus pointer) dividing by zero.
>
> The attached patch simply changes malloc() to calloc(), so the pointer is
> always set to NULL. As a side benefit it gets rid of one #ifdef
> LOADER_GELI_SUPPORT.
>

This patch looks fine to me.

Warner


More information about the svn-src-head mailing list