From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1c308n-0004yy-Ly for mharc-grub-devel@gnu.org; Sat, 05 Nov 2016 08:32:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c308m-0004yn-0w for grub-devel@gnu.org; Sat, 05 Nov 2016 08:32:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c308h-0006WK-AI for grub-devel@gnu.org; Sat, 05 Nov 2016 08:32:08 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:36599) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c308h-0006Uy-2C for grub-devel@gnu.org; Sat, 05 Nov 2016 08:32:03 -0400 Received: by mail-lf0-x241.google.com with SMTP id o20so6101415lfg.3 for ; Sat, 05 Nov 2016 05:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=/uzfwdWayLV/0o3zPGUS+UmzrgT/gSVZt8/W98+5JBE=; b=LR0P3StfsnG/dGq+PTqO4VX5vyxONkrTOGGWByCiecR1UxM34R/q2/lQVTWSrLUdXY ccxN2jILL38hIgswh8vD1jZ5EJGYi0lKB/aOoFDlQk6QqhJWp2BenA3z6YBSufMNUdCm 0j3YTkGphHHWkPrl06nIvzH3YA8P09GHBiQ49DXivnJD7quth8fOLDemEd2thvbfziY+ G/ez+6RbskUDdRyekxl8kkxKwB591mSzPJYf+g3wXsIDric00OyJffBkh/xgT6sAuBvm bD9BoCtCMWsLOC0bHTdMo8mC4q6JYVhCljvoUrha7KK6SdTvrTY8IXmgwL1WBanzjx5c fpUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=/uzfwdWayLV/0o3zPGUS+UmzrgT/gSVZt8/W98+5JBE=; b=V7PZybLnQvt4Y/HDN0uySQYONZeeYq/WFiPM9X1oGngLayjkwUbnOd2tWJ4DKb1BHo cOx98Xktj6fXA0tYuy0aIYeTK4HUBPMyIEE06sMltW5Dd+7fo8ey5uBN5zIJ0ptE0nuc xUc7EvzF/mjUOz21q/MTqfUG29CeHs9vNv3jdT5Qkl/6qVtCHnqEJqhd8dO8iLoKMrTO iqYUdt/0GpmAuoYhGD6tS9FzvhTd7Vn5uGkt96D8XHQGEzUY/x4HerrA7nDU+2n0olhu q5QsfnvouhBt4YJbKVq30HXkfe6Qn+91jQP4pxpOtnuoCmY4m+rvWoNBCbrRUe+8vLOh AO7w== X-Gm-Message-State: ABUngvcWsa25zedoyW6yj99JbPR36Jj3iyePv8arYpindkJiemPbd2atE81zsgxDZWiHDA== X-Received: by 10.25.221.8 with SMTP id u8mr9838275lfg.40.1478349120770; Sat, 05 Nov 2016 05:32:00 -0700 (PDT) Received: from [192.168.1.44] (ppp109-252-90-55.pppoe.spdop.ru. [109.252.90.55]) by smtp.gmail.com with ESMTPSA id f198sm3218866lfe.10.2016.11.05.05.31.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Nov 2016 05:31:59 -0700 (PDT) Subject: Re: [PATCH] fix detection of non-LUKS CRYPT To: The development of GNU GRUB References: <43313b6e-80c2-fafb-286b-47db8b180f6a@fatooh.org> From: Andrei Borzenkov Message-ID: <08fec14a-a356-04c9-b135-80da3005efc3@gmail.com> Date: Sat, 5 Nov 2016 15:31:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <43313b6e-80c2-fafb-286b-47db8b180f6a@fatooh.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::241 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Nov 2016 12:32:09 -0000 05.11.2016 07:58, Corey Hickey пишет: > Recent grub no longer detects non-LUKS ("plain dm-crypt") devices > properly. I think I tracked it down; the following patch fixes the > problem for me. > > > commit 4eb670dc50fe84012ec3e1f226ef9e94d8fa4b2b > Author: Corey Hickey > Date: Sun Oct 30 22:35:32 2016 -0700 > > devmapper: fix detection of non-LUKS CRYPT > > grub_util_get_dm_abstraction() does a string comparison of insufficient > length. When using a UUID such as "CRYPT-PLAIN-sda6_crypt", the function > returns GRUB_DEV_ABSTRACTION_LUKS. > > This results in the error: > ./grub-probe: error: disk `cryptouuid/sda6_crypt' not found. > > This appears to be a copy/paste error introduced in: > a10e7a5a8918bea6e2632055129fa9b516fe965a > > The bug was (apparently) latent until revealed by: > 3bca85b4184f74995a7cc2791e432173fde26d34 > > Signed-off-by: Corey Hickey > > diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c > index 72e5582..a13a39c 100644 > --- a/grub-core/osdep/devmapper/getroot.c > +++ b/grub-core/osdep/devmapper/getroot.c > @@ -143,7 +143,7 @@ grub_util_get_dm_abstraction (const char *os_dev) > grub_free (uuid); > return GRUB_DEV_ABSTRACTION_LVM; > } > - if (strncmp (uuid, "CRYPT-LUKS1-", 4) == 0) > + if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0 Committed, thanks! We really need some wrapper around (strncmp (foo, "bar", sizeof ("bar") - 1), but for now it is OK as bug fix. P.S. please in future either use git send-email or attach git format-patch to make it easier to apply. Thank you. > { > grub_free (uuid); > return GRUB_DEV_ABSTRACTION_LUKS; > > > Thanks, > Corey > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >