Date: Sat, 4 Aug 2018 14:30:45 -0600 From: Warner Losh <imp@bsdimp.com> To: Kristof Provost <kp@freebsd.org> Cc: Ian Lepore <ian@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: 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... Message-ID: <CANCZdfp%2BBRzLNQe-drZKX2Pvk=OudozmkJNT_FdyOMFWDT1O-Q@mail.gmail.com> In-Reply-To: <9CB310A7-0612-472C-91F0-4B0EB7D75912@FreeBSD.org> References: <201807131750.w6DHoPD9024230@repo.freebsd.org> <9CB310A7-0612-472C-91F0-4B0EB7D75912@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 4, 2018 at 1:57 PM, Kristof Provost <kp@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 movin= g > 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_fi= le > 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=E2=80=99t 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfp%2BBRzLNQe-drZKX2Pvk=OudozmkJNT_FdyOMFWDT1O-Q>