grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix detection of non-LUKS CRYPT


From: Andrei Borzenkov
Subject: Re: [PATCH] fix detection of non-LUKS CRYPT
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

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 <address@hidden>
> 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 <address@hidden>
> 
> 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
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]