From owner-svn-src-all@freebsd.org Sat Aug 4 20:30:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0F621052331 for ; Sat, 4 Aug 2018 20:30:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C59886FA4 for ; Sat, 4 Aug 2018 20:30:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id p81-v6so13191015itp.1 for ; Sat, 04 Aug 2018 13:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=bn4/RECcwGF0eoPSpINyOenGMvABfJkM47UM1vOb39g=; b=tryjB1Npr935tU3fppI3HLw2x0EA/6J/lbpr/jF2Vg1NO75aoXaXTRuZ55y6E2JPy2 i0HKencKL/4V1uqsw85gSlFtN0O2sk0mveDefYoGMnj0cdt3EWYLrCPD7Fdj7VqHy9cL L8jw+MdrnAlC+P4SNFCm7WPxW3t22F2/Hv1tLkN/daJ31cQ85+MX7hqP5RT2EN5MSn4/ MExRb+HyqHBE1j44jMzQ8paxXBJivenUfI18KUe1Sbo8EqO0HRBOYJ0F3/lm3GT+DFZi Br/2K0IoHKqJpWrQeI5ZpAqbTn7AbcdCVQiKPDYzv6Sh7gwGhVzTgjAXX2gp+LoThQuu sStQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=bn4/RECcwGF0eoPSpINyOenGMvABfJkM47UM1vOb39g=; b=WAx0QhmTK8a/OyDOsQHQqLCg5zMNhvikoM76+IH4LcQVjEs6N3QFlQ2h3xnj9HYStb FE7BAxP2DCXEkcvOt5B6yDgOlMygHJjIFyRe5ZHJrambnsa0xfMML4jBLhTvcnNcinAF HkMkbQlOSQ4785g2NB3Tv6WlAiCHfrgiJLAcVY8bkUrUWnmuqAuWiSoUW7tQrUpketIU fpns1VbD/T0QToX4a9HUfCTFNElxCyoE6iZQneWsn+xpfa538XztrZJ/K6sSV5ubbWyM aEgjTa+/ppnhx0AelMJkYERVgrVDE5IHSmd+5dcWezWeIQHgOh4YNVWm7qsN41+KCD2s JHQw== X-Gm-Message-State: AOUpUlHSlG19miMc+9e1U9X2UZCw4jCjpCFQ+8ZbKCk5nk7OjAfUnm+U YM7vJkY4woAQ0RS0P5go2BtCkuSBHwSubcaHL+gOTg== X-Google-Smtp-Source: AAOMgpcDeGmDpPoZJvQuTJfFF5x9io3gj6mxXUaLiygVPK4LgMR61rvPvXpDAc3NLW+6g0GLt7aDjYi9f14Z5OGQRHc= X-Received: by 2002:a24:4f52:: with SMTP id c79-v6mr10595895itb.36.1533414646380; Sat, 04 Aug 2018 13:30:46 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:4485:0:0:0:0:0 with HTTP; Sat, 4 Aug 2018 13:30:45 -0700 (PDT) X-Originating-IP: [86.153.210.77] In-Reply-To: <9CB310A7-0612-472C-91F0-4B0EB7D75912@FreeBSD.org> References: <201807131750.w6DHoPD9024230@repo.freebsd.org> <9CB310A7-0612-472C-91F0-4B0EB7D75912@FreeBSD.org> From: Warner Losh Date: Sat, 4 Aug 2018 14:30:45 -0600 X-Google-Sender-Auth: 5fnMcZ-hBvtfV2l-WmjOs4SEwBI Message-ID: 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... To: Kristof Provost Cc: Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2018 20:30:47 -0000 On Sat, Aug 4, 2018 at 1:57 PM, Kristof Provost 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