Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2144572

Summary: annocheck says skip: stack-prot test because compiling in LTO mode hides the -fstack-protector-strong option
Product: Red Hat Enterprise Linux 9 Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: os-proberAssignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED ERRATA QA Contact: Robin Hack <rhack>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: bootloader-eng-team, jpazdziora, mhaicman, mlewando, nickc, raravind, rhack
Target Milestone: rcKeywords: TestCaseNotNeeded, Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
URL: https://src.fedoraproject.org/rpms/os-prober/pull-request/1
Whiteboard:
Fixed In Version: os-prober-1.77-10.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2159831 2167424 2167426 (view as bug list) Environment:
Last Closed: 2023-05-09 08:26:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2159831, 2167424, 2167426    

Description Jan Pazdziora (Red Hat) 2022-11-21 18:05:04 UTC
Description of problem:

On /usr/libexec/os-prober/newns, annocheck says that stack-prot test gets skipped because compiling in LTO mode hides the -fstack-protector-strong option. But on other binaries it seems to report both LTO and stack-prot just fine.

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

annobin-annocheck-10.54-2.el9.x86_64
os-prober-1.77-9.el9.x86_64
bash-5.1.8-4.el9.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. dnf install -y annobin-annocheck os-prober bash
2. dnf debuginfo-install -y os-prober bash
3. annocheck --verbose --skip-all --test-stack-prot --test-lto /usr/bin/bash
4. Check that the output is

annocheck: Version 10.54.
Hardened: /usr/bin/bash: PASS: stack-prot test 
Hardened: /usr/bin/bash: PASS: lto test because detected in DWARF information 
Hardened: /usr/bin/bash: Overall: PASS.

5. annocheck --verbose --skip-all --test-stack-prot --test-lto /usr/libexec/os-prober/newns

Actual results:

annocheck: Version 10.54.
Hardened: /usr/libexec/os-prober/newns: PASS: lto test because detected in version note 
Hardened: /usr/libexec/os-prober/newns: skip: stack-prot test because compiling in LTO mode hides the -fstack-protector-strong option 
Hardened: /usr/libexec/os-prober/newns: Overall: PASS.

Expected results:

No skip of the stack-prot test, just like on bash.

Additional info:

Comment 1 Jan Pazdziora (Red Hat) 2022-11-22 18:41:52 UTC
Checking with

readelf -Ws /usr/libexec/os-prober/newns | grep '__stack_chk_fail'

does not find anything, meaning the function to be called when the stack protection detects a corrupted stack is not referenced. So it seems to suggest -fstack-protector-strong was not used.

Comment 2 Jan Pazdziora (Red Hat) 2022-11-22 18:55:49 UTC
Let me move this bugzilla to the os-prober component since the suspicion of missing compiler flags is real.

Comment 4 Nick Clifton 2022-11-28 12:03:19 UTC
(In reply to Jan Pazdziora from comment #1)
[Clearing the needinfo from me ...]


> Checking with
> 
> readelf -Ws /usr/libexec/os-prober/newns | grep '__stack_chk_fail'
> 
> does not find anything, meaning the function to be called when the stack
> protection detects a corrupted stack is not referenced. So it seems to
> suggest -fstack-protector-strong was not used.

Agreed.  This is likely another case where the code was compiled without security options enabled, or annobin annotation enabled.

Comment 22 errata-xmlrpc 2023-05-09 08:26:35 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 (os-prober 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:2587