public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elf: Change ldconfig auxcache magic number (bug 32231)
@ 2024-10-24  5:52 Florian Weimer
  2024-10-24 17:43 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2024-10-24  5:52 UTC (permalink / raw)
  To: libc-alpha

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>

---
 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


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

* Re: [PATCH] elf: Change ldconfig auxcache magic number (bug 32231)
  2024-10-24  5:52 [PATCH] elf: Change ldconfig auxcache magic number (bug 32231) Florian Weimer
@ 2024-10-24 17:43 ` Adhemerval Zanella Netto
  2024-10-24 18:25   ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella Netto @ 2024-10-24 17:43 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha



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
> 


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

* Re: [PATCH] elf: Change ldconfig auxcache magic number (bug 32231)
  2024-10-24 17:43 ` Adhemerval Zanella Netto
@ 2024-10-24 18:25   ` Florian Weimer
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2024-10-24 18:25 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: libc-alpha

* Adhemerval Zanella Netto:

> 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>

Thanks.

I don't see a problem with backparting this.  It just triggers
unnecessary auxcache regeneration on upgrades/downgrades between
compatible versions.  But it will fix the update across incompatible
versions.

Thanks,
Florian


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

end of thread, other threads:[~2024-10-24 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-24  5:52 [PATCH] elf: Change ldconfig auxcache magic number (bug 32231) Florian Weimer
2024-10-24 17:43 ` Adhemerval Zanella Netto
2024-10-24 18:25   ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).