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 2109510 - glibc: Switch to custom linker script using --with-default-link=no for RELRO hardening
Summary: glibc: Switch to custom linker script using --with-default-link=no for RELRO ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.7
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: Martin Coufal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-21 13:01 UTC by Florian Weimer
Modified: 2023-05-16 10:59 UTC (History)
10 users (show)

Fixed In Version: glibc-2.28-220.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-16 09:03:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-128609 0 None None None 2022-07-21 13:05:33 UTC
Red Hat Product Errata RHBA-2023:2955 0 None None None 2023-05-16 09:03:26 UTC

Description Florian Weimer 2022-07-21 13:01:03 UTC
We need to enable the custom linker script to improve RELRO hardening. Upstream did this with this patch:

commit 198abcbb94618730dae1b3f4393efaa49e0ec8c7
Author: Florian Weimer <fweimer>
Date:   Mon Apr 11 11:30:31 2022 +0200

    Default to --with-default-link=no (bug 25812)
    
    This is necessary to place the libio vtables into the RELRO segment.
    New tests elf/tst-relro-ldso and elf/tst-relro-libc are added to
    verify that this is what actually happens.
    
    The new tests fail on ia64 due to lack of (default) RELRO support
    inbutils, so they are XFAILed there.

Downstream, we can just pass --with-default-link=no in the configure invocation, no new patch required.

The upstream change comes with a test, but it depends on scripts/glibcelf.py, which is unfortunately a backport hazard. We can consider backporting the test as a later stage.

Comment 1 Florian Weimer 2022-07-22 08:46:16 UTC
Note to QE: This can be tested using the *upstream* elf/tst-relro-symbols.py test case, like this:

$ python3 elf/tst-relro-symbols.py /path/to/lib/libc-2.28.so \
            --required=_IO_cookie_jumps \
            --required=_IO_file_jumps \
            --required=_IO_file_jumps_maybe_mmap \
            --required=_IO_file_jumps_mmap \
            --required=_IO_helper_jumps \
            --required=_IO_mem_jumps \
            --required=_IO_obstack_jumps \
            --required=_IO_proc_jumps \
            --required=_IO_str_chk_jumps \
            --required=_IO_str_jumps \
            --required=_IO_strn_jumps \
            --required=_IO_wfile_jumps \
            --required=_IO_wfile_jumps_maybe_mmap \
            --required=_IO_wfile_jumps_mmap \
            --required=_IO_wmem_jumps \
            --required=_IO_wstr_jumps \
            --required=_IO_wstrn_jumps \
            --optional=_IO_old_cookie_jumps \
            --optional=_IO_old_file_jumps \
            --optional=_IO_old_proc_jumps \

See elf/Makefile for the command.

We cannot backport elf/tst-relro-symbols.py at this time because of the way it is written upstream, it creates a backporting hazard: there is a test that checks scripts/glibcelf.py against elf/elf.h, but both are not necessarily updated at the same time upstream. This needs to be fixed upstream at some point.

Comment 2 Florian Weimer 2022-07-22 08:57:45 UTC
eu-readelf -l is another way to check this.  If __libc_IO_vtables appears on a RELRO line, we are good:

   09      [RELRO: .tdata .tbss .init_array __libc_subfreeres __libc_atexit __libc_IO_vtables .data.rel.ro .dynamic .got]

And it turns out that for some reason, the segment layout in ourbuilds has RELRO hardening. So I'm moving this out to 8.8, so that we can backport the fixed upstream test (without the backporting hazard). Given that everything looks alright already, we do not need to make a code change at this time.

Comment 8 errata-xmlrpc 2023-05-16 09:03:05 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-2023:2955


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