[PATCH] elf: Change ldconfig auxcache magic number (bug 32231)

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu Oct 24 17:43:38 GMT 2024



On 24/10/24 02:52, Florian Weimer wrote:
> In commit c628c2296392ed3bf2cb8d8470668e64fe53389f (elf: Remove
> ldconfig kernel version check), the layout of auxcache entries
> changed because the osversion field was removed from
> struct aux_cache_file_entry.  However, AUX_CACHEMAGIC was not
> changed, so existing files are still used, potentially leading
> to unintended ldconfig behavior.  This commit changes AUX_CACHEMAGIC,
> so that the file is regenerated.
> 
> Tested on x86_64-linux-gnu.  Verified manually that the early exit in
> load_aux_cache is taken due to the change in file magic.
> 
> Reported-by: DJ Delorie <dj@redhat.com>

Ouch, I should have know better about this one.  I think it is too late
to backport this now.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
> ---
>  elf/cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/elf/cache.c b/elf/cache.c
> index 8a618e11fa..62d681df42 100644
> --- a/elf/cache.c
> +++ b/elf/cache.c
> @@ -820,7 +820,7 @@ struct aux_cache_entry
>    struct aux_cache_entry *next;
>  };
>  
> -#define AUX_CACHEMAGIC		"glibc-ld.so.auxcache-1.0"
> +#define AUX_CACHEMAGIC		"glibc-ld.so.auxcache-2.0"
>  
>  struct aux_cache_file_entry
>  {
> 
> base-commit: c5dd659f22058bf9b371ab1cba07631f1206c674
> 



More information about the Libc-alpha mailing list