From 5f311e86d296fd8a7a16faa01bc87b26c1e5aa86 Mon Sep 17 00:00:00 2001 From: Corey Hickey Date: Fri, 4 Nov 2016 21:58:14 -0700 Subject: [PATCH] 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 --- grub-core/osdep/devmapper/getroot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c index 72e558275..a13a39c96 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;