GNU bug report logs - #52693
[PATCH] gnu: glibc: Handle failure to find $ORIGIN.

Previous Next

Package: guix-patches;

Reported by: Ivan Kozlov <kanichos <at> yandex.ru>

Date: Tue, 21 Dec 2021 01:27:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#52693: closed ([PATCH] gnu: glibc: Handle failure to find
 $ORIGIN.)
Date: Sun, 29 Jan 2023 23:35:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 30 Jan 2023 00:34:40 +0100
with message-id <878rhk3ofj.fsf <at> gnu.org>
and subject line Re: bug#52693: [PATCH] gnu: glibc: Handle failure to find $ORIGIN.
has caused the debbugs.gnu.org bug report #52693,
regarding [PATCH] gnu: glibc: Handle failure to find $ORIGIN.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
52693: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52693
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ivan Kozlov <kanichos <at> yandex.ru>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: glibc: Handle failure to find $ORIGIN.
Date: Tue, 21 Dec 2021 04:25:50 +0300
Fixes <https://issues.guix.gnu.org/52671>.

* gnu/packages/patches/glibc-dl-cache.patch: Check pointer returned by '_dl_get_origin' for failure indication.
---
 gnu/packages/patches/glibc-dl-cache.patch | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/patches/glibc-dl-cache.patch b/gnu/packages/patches/glibc-dl-cache.patch
index 68c3a94846..1535e8e9c9 100644
--- a/gnu/packages/patches/glibc-dl-cache.patch
+++ b/gnu/packages/patches/glibc-dl-cache.patch
@@ -3,10 +3,10 @@ from /etc/ld.so.cache.  Also arrange so that this cache takes
 precedence over RUNPATH.

 diff --git a/elf/dl-cache.c b/elf/dl-cache.c
-index 93d185e788..e0760a1f40 100644
+index 93d185e788..801452692d 100644
 --- a/elf/dl-cache.c
 +++ b/elf/dl-cache.c
-@@ -171,6 +171,51 @@ _dl_cache_libcmp (const char *p1, const char *p2)
+@@ -171,6 +171,52 @@ _dl_cache_libcmp (const char *p1, const char *p2)
    return *p1 - *p2;
  }

@@ -27,7 +27,8 @@ index 93d185e788..e0760a1f40 100644
 +      const char *origin = _dl_get_origin ();
 +
 +      /* Check whether ORIGIN is something like "/gnu/store/…-foo/bin".  */
-+      if (strncmp (store, origin, strlen (store)) == 0
++      if (origin != (char *)-1 /* _dl_get_origin reported failure */
++        && strncmp (store, origin, strlen (store)) == 0
 +        && origin[sizeof store - 1] == '/')
 +      {
 +        char *store_item_end = strchr (origin + sizeof store, '/');
@@ -58,7 +59,7 @@ index 93d185e788..e0760a1f40 100644

  /* Look up NAME in ld.so.cache and return the file name stored there, or null
     if none is found.  The cache is loaded if it was not already.  If loading
-@@ -190,12 +235,15 @@ _dl_load_cache_lookup (const char *name)
+@@ -190,12 +236,15 @@ _dl_load_cache_lookup (const char *name)

    /* Print a message if the loading of libs is traced.  */
    if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))

base-commit: 88b4dcdabe512992ae79a50fc333e4e463d91634
--
2.28.0


[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Ivan Kozlov <kanichos <at> yandex.ru>
Cc: 52693-done <at> debbugs.gnu.org, 52671-done <at> debbugs.gnu.org
Subject: Re: bug#52693: [PATCH] gnu: glibc: Handle failure to find $ORIGIN.
Date: Mon, 30 Jan 2023 00:34:40 +0100
Hi Ivan,

Ivan Kozlov <kanichos <at> yandex.ru> skribis:

> Fixes <https://issues.guix.gnu.org/52671>.
>
> * gnu/packages/patches/glibc-dl-cache.patch: Check pointer returned by '_dl_get_origin' for failure indication.

Somehow we forgot about this patch for a whole year, and it turns out I
stumbled upon the bug again just hours ago¹.

Now pushed to ‘core-updates’ as
edb8c09addd186d9538d43b12af74d6c7aeea082.

Thanks again, and apologies for the delay!

Ludo’.

¹ https://issues.guix.gnu.org/61156


This bug report was last modified 2 years and 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.