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 1703500

Summary: annobin: Missing _FORTIFY_SOURCE macro results in MAYBE
Product: Red Hat Enterprise Linux 8 Reporter: Florian Weimer <fweimer>
Component: annobinAssignee: Nick Clifton <nickc>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: fweimer, law, mcermak, nickc
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: annobin-8.77-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1703499
: 1904479 (view as bug list) Environment:
Last Closed: 2019-11-05 20:54:32 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: 1703499    
Bug Blocks:    

Description Florian Weimer 2019-04-26 15:18:16 UTC
+++ This bug was initially created as a clone of Bug #1703499 +++

Reproducer:

echo 'int main(void) {}' > u.c
gcc `rpm --eval "%build_cflags %build_ldflags" | sed s/-Wp,-D_FORTIFY_SOURCE=2//` u.c
annocheck -v a.out

Actual output:

Hardened: a.out: MAYB: (component: main): -D_FORTIFY_SOURCE setting not recorded.
Hardened: a.out: MAYB: (component: main): -D_FORTIFY_SOURCE setting not recorded.
[…]

Expected output:

I think this should be a failure because we know that there is annobin-covered code which does not use the right _FORTIFY_SOURCE setting.

Comment 1 Nick Clifton 2019-04-30 14:59:10 UTC
A fix is available (and applied in rawhide: annobin-8.76-1.fc31). 
Waiting for the necessary ACKs  in order to apply it here.

Comment 2 Nick Clifton 2019-06-04 15:43:09 UTC
Fixed in annobin-8.76-1.el8

Comment 4 Martin Cermak 2019-06-24 08:27:31 UTC
Nick, I'm not sure if this is really fixed. Here is what I see:

=======
scr0   8.1 Server x86_64 # rpm -q annobin redhat-rpm-config
annobin-8.76-2.el8.x86_64
redhat-rpm-config-119-1.el8.noarch
scr0   8.1 Server x86_64 # echo 'int main(void) {}' > u.c
scr0   8.1 Server x86_64 # gcc `rpm --eval "%build_cflags %build_ldflags" | sed s/-Wp,-D_FORTIFY_SOURCE=2//` u.c
scr0   8.1 Server x86_64 # annocheck -v a.out
annocheck: Version 8.76.
Hardened: a.out: binary producer gcc version 8.
Hardened: a.out: MAYB: (component: main): -D_FORTIFY_SOURCE setting not recorded.
Hardened: a.out: MAYB: (component: main): -D_FORTIFY_SOURCE setting not recorded.
Hardened: a.out: PASS: No gaps found.
Hardened: a.out: PASS: Linked with -Wl,-z,now.
Hardened: a.out: PASS: Compiled with -fcf-protection.
Hardened: a.out: PASS: One dynamic section/segment found.
Hardened: a.out: PASS: Entry point instruction is ENDBR.
Hardened: a.out: MAYB: Some parts of the binary do not record if -D_FORTIFY_SOURCE=2 was used.
Hardened: a.out: PASS: Compiled with -D_GLIBCXX_ASSERTIONS.
Hardened: a.out: PASS: Linked with -Wl,-z,relro.
Hardened: a.out: PASS: Stack not executable.
Hardened: a.out: PASS: Compiled with sufficient optimization.
Hardened: a.out: PASS: Compiled with PIC/PIE.
Hardened: a.out: PASS: Compiled as a position independent binary.
Hardened: a.out: PASS: Good GNU Property note.
Hardened: a.out: PASS: DT_RPATH/DT_RUNPATH absent or rooted at /usr.
Hardened: a.out: PASS: No RWX segments found.
Hardened: a.out: PASS: Consistent use of the -fshort-enum option.
Hardened: a.out: PASS: Compiled with -fstack-clash-protection.
Hardened: a.out: PASS: Compiled with sufficient stack protection.
Hardened: a.out: skip: Test for stack realignment support.  (Only needed on i686 binaries).
Hardened: a.out: PASS: No text relocations found.
Hardened: a.out: PASS: No thread cancellation problems.
Hardened: a.out: PASS: GOT/PLT relocations are read only.
(1) scr0   8.1 Server x86_64 # 
=======

What upstream commit fixes this issue, please?

Comment 5 Nick Clifton 2019-06-24 12:03:54 UTC
(In reply to Martin Cermak from comment #4)
> Nick, I'm not sure if this is really fixed.

Agreed :-(  I fixes the wrong problem.  Moving back to ASSIGNED.

Comment 6 Nick Clifton 2019-06-24 13:20:41 UTC
Trying again... :-)

Fixerd in annobin-8.77-1.el8

Comment 8 errata-xmlrpc 2019-11-05 20:54:32 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, 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-2019:3356