RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1934162 - glibc: ldconfig segfaults when dynamic tokens are in LD_LIBRARY_PATH
Summary: glibc: ldconfig segfaults when dynamic tokens are in LD_LIBRARY_PATH
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: DJ Delorie
QA Contact: Sergey Kolosov
Petr Hybl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-02 15:57 UTC by Sebastien Aime
Modified: 2023-07-18 14:30 UTC (History)
9 users (show)

Fixed In Version: glibc-2.28-171.el8
Doc Type: Bug Fix
Doc Text:
.Statically linked applications no longer crash Previously, the initialization code of the dynamic loader, which is linked into statically linked binaries, did not initialize a link map variable correctly. Consequently, statically linked applications crashed if `LD_LIBRABY__PATH` contained a dynamic token string. With this update statically linked applications no longer crash.
Clone Of:
Environment:
Last Closed: 2022-05-10 15:17:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1609351 1 unspecified CLOSED glibc: ldconfig segfaults when dynamic tokens are in LD_LIBRARY_PATH 2021-05-18 15:57:51 UTC
Red Hat Product Errata RHBA-2022:2005 0 None None None 2022-05-10 15:17:53 UTC
Sourceware 23462 0 P2 RESOLVED Static binary with dynamic string tokens ($LIB, $PLATFORM, $ORIGIN) crashes 2021-04-16 14:07:39 UTC

Description Sebastien Aime 2021-03-02 15:57:07 UTC
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

Comment 1 Florian Weimer 2021-03-05 15:25:26 UTC
Thanks for the report. As a first step, we are going to revive the upstream patch and get it fixed there.

Comment 3 Florian Weimer 2021-04-16 14:09:19 UTC
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>

Comment 13 errata-xmlrpc 2022-05-10 15:17:34 UTC
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


Note You need to log in before you can comment on or make changes to this bug.