All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix detection of non-LUKS CRYPT
@ 2016-11-05  4:58 Corey Hickey
  2016-11-05 12:31 ` Andrei Borzenkov
  0 siblings, 1 reply; 7+ messages in thread
From: Corey Hickey @ 2016-11-05  4:58 UTC (permalink / raw)
  To: grub-devel

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 <bugfood-c@fatooh.org>
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 <bugfood-c@fatooh.org>

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)
     {
       grub_free (uuid);
       return GRUB_DEV_ABSTRACTION_LUKS;


Thanks,
Corey


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-12  6:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-05  4:58 [PATCH] fix detection of non-LUKS CRYPT Corey Hickey
2016-11-05 12:31 ` Andrei Borzenkov
2016-11-06  7:09   ` Corey Hickey
2016-11-06 10:01     ` Andrei Borzenkov
2016-11-07  6:48       ` Corey Hickey
2016-11-07 11:04         ` Andrei Borzenkov
2016-11-12  6:29           ` Corey Hickey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.