Hide Forgot
Using a syntax such as the examples below segfaults on RHEL8: $ LD_LIBRARY_PATH=\$LIB ldconfig -p >/dev/null Segmentation fault (core dumped) $ LD_LIBRARY_PATH='$LIB' ldconfig -p >/dev/null Segmentation fault (core dumped) I have found a similar bug report for Fedora 30: https://bugzilla.redhat.com/show_bug.cgi?id=1609351
Thanks for the report. As a first step, we are going to revive the upstream patch and get it fixed there.
Upstream commits to backport: commit 4e6db99c665d3b82a70a3e218860ef087b1555b4 Author: Florian Weimer <fweimer> Date: Mon Mar 15 10:33:43 2021 +0100 elf: ld.so --help calls _dl_init_paths without a main map [BZ #27577] In this case, use the link map of the dynamic loader itself as a replacement. This is more than just a hack: if we ever support DT_RUNPATH/DT_RPATH for the dynamic loader, reporting it for ld.so --help (without further command line arguments) would be the right thing to do. Fixes commit 332421312576bd7095e70589154af99b124dd2d1 ("elf: Always set l in _dl_init_paths (bug 23462)"). commit 332421312576bd7095e70589154af99b124dd2d1 Author: Carlos O'Donell <carlos> Date: Fri Mar 12 16:44:47 2021 +0100 elf: Always set l in _dl_init_paths (bug 23462) After d1d5471579eb0426671bf94f2d71e61dfb204c30 ("Remove dead DL_DST_REQ_STATIC code.") we always setup the link map l to make the static and shared cases the same. The bug is that in elf/dl-load.c (_dl_init_paths) we conditionally set l only in the #ifdef SHARED case, but unconditionally use it later. The simple solution is to remove the #ifdef SHARED conditional, because it's no longer needed, and unconditionally setup l for both the static and shared cases. A regression test is added to run a static binary with LD_LIBRARY_PATH='$ORIGIN' which crashes before the fix and runs after the fix. Co-Authored-By: Florian Weimer <fweimer>
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (glibc bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:2005