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 2022973 - annobin needs to be taught about /usr/sbin/ldconfig
Summary: annobin needs to be taught about /usr/sbin/ldconfig
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: annobin
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nick Clifton
QA Contact: Václav Kadlčík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-13 15:04 UTC by Jan Pazdziora
Modified: 2022-05-17 12:48 UTC (History)
12 users (show)

Fixed In Version: annobin-10.25-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:33:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-102673 0 None None None 2021-11-13 15:05:53 UTC
Red Hat Product Errata RHEA-2022:2342 0 None None None 2022-05-17 12:33:19 UTC

Description Jan Pazdziora 2021-11-13 15:04:06 UTC
Description of problem:

The ldconfig file is packaged by glibc as /sbin/ldconfig even if /sbin is a symlink to /usr/sbin so the file actually lands on disk as /usr/sbin/ldconfig.

One effect of this inconsistency is that on aarch64, it then causes annocheck to fail when we try to test all files on the disk, while avoiding symlinks.

Version-Release number of selected component (if applicable):

glibc-2.34-7.el9.aarch64
annobin-annocheck-10.23-1.el9.aarch64

How reproducible:

Deterministic.

Steps to Reproduce:
1. dnf install -y /usr/bin/annocheck /sbin/ldconfig
2. dnf -y --nogpgcheck debuginfo-install glibc glibc-gconv-extra
3. annocheck --verbose --ignore-gaps --skip-all --test-stack-prot /sbin/ldconfig
4. annocheck --verbose --ignore-gaps --skip-all --test-stack-prot /usr/sbin/ldconfig

Actual results:

annocheck: Version 10.23.
Hardened: /usr/sbin/ldconfig: Command line options not recorded in DWARF DW_AT_producer variable.
Hardened: /usr/sbin/ldconfig: info: ALSO written in C (source: DW_AT_language string).
Hardened: /usr/sbin/ldconfig: PASS: stack-prot test 
Hardened: /usr/sbin/ldconfig: skip: stack-prot test because function _dl_start is part of the C library's startup code, which executes before stack protection is established 
Hardened: /usr/sbin/ldconfig: FAIL: stack-prot test because stack protection deliberately disabled (function: _dl_tls_static_surplus_init) 
Hardened: /usr/sbin/ldconfig: info: For more information visit: https://sourceware.org/annobin/annobin.html/Test-stack-prot.html
Hardened: ldconfig: Overall: FAIL.

Expected results:

annocheck: Version 10.23.
Hardened: /usr/sbin/ldconfig: Command line options not recorded in DWARF DW_AT_producer variable.
Hardened: /usr/sbin/ldconfig: info: ALSO written in C (source: DW_AT_language string).
Hardened: /usr/sbin/ldconfig: PASS: stack-prot test 
Hardened: /usr/sbin/ldconfig: skip: stack-prot test because the ldconfig binary is a special case, hand-crafted by the glibc build system 
Hardened: ldconfig: Overall: PASS.

Additional info:

Comment 1 Jan Pazdziora 2021-11-13 15:07:33 UTC
I filed this against glibc because the inconsistency of the %files with the disk layout bothers me in general. But maybe annocheck should be able to handle this situation gracefully.

Adding Nick to Cc for potential assessment whether this is truly just a bug in annocheck.

Comment 3 Nick Clifton 2021-11-15 14:05:19 UTC
(In reply to Jan Pazdziora from comment #1)

> Adding Nick to Cc for potential assessment whether this is truly just a bug
> in annocheck.

It kind of is and is not a bug.  Annocheck has a special exception for the ldconfig executable because it is known to be built in a special way, and without a lot of the usual security features.  The code however checks the absolute path:

  /* The ldconfig binary is known to be compiled with most security features.  */
  if (streq (data->full_filename, "/sbin/ldconfig"))
    {
      sprintf (reason, "the ldconfig binary is a special case, hand-crafted by the glibc build system");
      skip (data, check < TEST_MAX ? check : TEST_NOTES, SOURCE_SKIP_CHECKS, reason);
      return true;
    }

I did this because I was trying to keep the exception as narrow as possible,  I did not want anybody to call their program "ldconfig" and then avoid the annocheck tests.  But obviously I missed the AArch64 symlink case.  I will fix this in the next release of annobin.

Comment 4 Florian Weimer 2021-11-15 14:09:51 UTC
We are going to implement full UsrMove in glibc eventually (maybe even for RHEL 9 GA), so annobin needs to be taught about /usr/sbin/ldconfig.

Comment 5 Nick Clifton 2021-11-16 17:33:40 UTC
Should be fixed in annobin-10.25-1.el9

Comment 12 errata-xmlrpc 2022-05-17 12:33:12 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 (new packages: annobin), 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/RHEA-2022:2342


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