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.
Created attachment 1782661[details]
reproducer binary
The end-to-end Sanity/annocheck-clean testcase does pass with base rhel-8.5 at this stage (RHEL-8.5.0-20210513.n.0). But it doesn't pass with the gcc-toolset-10 toolchain:
# What package versions do we use?
--------------------------------------------------------
8.5 Server x86_64 # for b in annocheck gcc as; do rpm -qf `which $b`; done
gcc-toolset-10-annobin-annocheck-9.29-1.el8.x86_64
gcc-toolset-10-gcc-10.2.1-8.2.el8.x86_64
gcc-toolset-10-binutils-2.35-6.el8.x86_64
8.5 Server x86_64 #
# What are the compile flags? (redhat-rpm-config-125-1.el8.noarch)
--------------------------------------------------------
8.5 Server x86_64 # GCC_SWITCHES=$(rpm --eval "%{build_cflags} %{build_ldflags}")
8.5 Server x86_64 # echo $GCC_SWITCHES
-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat8.5 8.5 Server x86_64 #
# The test inself
--------------------------------------------------------
8.5 Server x86_64 # gcc -v $GCC_SWITCHES stat.c -o stat >&/dev/null
8.5 Server x86_64 # annocheck -v stat
annocheck: Version 9.29.
Hardened: stat: info: Set binary producer to gcc version 8.
Hardened: stat: warn: Multiple versions of a tool were used to build this file (10 8) - using highest version.
Hardened: stat: FAIL: (component: main): Compiled without -fstack-clash-protection.
Hardened: stat: FAIL: (component: main): Compiled without -fcf-protection.
Hardened: stat: PASS: No gaps found.
Hardened: stat: skip: Test for -Wl,-z-now. (Dynamic segment present, but no dynamic relocations found).
Hardened: stat: skip: Branch protection. (Not an AArch64 binary).
Hardened: stat: FAIL: Parts of the binary were compiled without sufficient -fcf-protection.
Hardened: stat: PASS: One dynamic section/segment found.
Hardened: stat: PASS: Entry point instruction is ENDBR.
Hardened: stat: PASS: Compiled with -D_FORTIFY_SOURCE=2.
Hardened: stat: PASS: Compiled with -D_GLIBCXX_ASSERTIONS.
Hardened: stat: skip: Test for -Wl,-z,relro. (No dynamic relocations).
Hardened: stat: PASS: Stack not executable.
Hardened: stat: PASS: Compiled with sufficient optimization.
Hardened: stat: PASS: Compiled with PIC/PIE.
Hardened: stat: PASS: Compiled as a position independent binary.
Hardened: stat: PASS: Good GNU Property note.
Hardened: stat: PASS: DT_RPATH/DT_RUNPATH absent or rooted at /usr.
Hardened: stat: PASS: No RWX segments found.
Hardened: stat: PASS: Consistent use of the -fshort-enum option.
Hardened: stat: FAIL: Parts of the binary were compiled without stack clash protection.
Hardened: stat: PASS: Compiled with sufficient stack protection.
Hardened: stat: skip: Test for stack realignment support. (Only needed on i686 binaries).
Hardened: stat: PASS: No text relocations found.
Hardened: stat: PASS: No thread cancellation problems.
Hardened: stat: PASS: Compiled with either -Wall and/or -Wformat-security.
Hardened: stat: PASS: GOT/PLT relocations are read only.
8.5 Server x86_64 #
Created attachment 1782661 [details] reproducer binary The end-to-end Sanity/annocheck-clean testcase does pass with base rhel-8.5 at this stage (RHEL-8.5.0-20210513.n.0). But it doesn't pass with the gcc-toolset-10 toolchain: # What package versions do we use? -------------------------------------------------------- 8.5 Server x86_64 # for b in annocheck gcc as; do rpm -qf `which $b`; done gcc-toolset-10-annobin-annocheck-9.29-1.el8.x86_64 gcc-toolset-10-gcc-10.2.1-8.2.el8.x86_64 gcc-toolset-10-binutils-2.35-6.el8.x86_64 8.5 Server x86_64 # # What are the compile flags? (redhat-rpm-config-125-1.el8.noarch) -------------------------------------------------------- 8.5 Server x86_64 # GCC_SWITCHES=$(rpm --eval "%{build_cflags} %{build_ldflags}") 8.5 Server x86_64 # echo $GCC_SWITCHES -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat8.5 8.5 Server x86_64 # # The test inself -------------------------------------------------------- 8.5 Server x86_64 # gcc -v $GCC_SWITCHES stat.c -o stat >&/dev/null 8.5 Server x86_64 # annocheck -v stat annocheck: Version 9.29. Hardened: stat: info: Set binary producer to gcc version 8. Hardened: stat: warn: Multiple versions of a tool were used to build this file (10 8) - using highest version. Hardened: stat: FAIL: (component: main): Compiled without -fstack-clash-protection. Hardened: stat: FAIL: (component: main): Compiled without -fcf-protection. Hardened: stat: PASS: No gaps found. Hardened: stat: skip: Test for -Wl,-z-now. (Dynamic segment present, but no dynamic relocations found). Hardened: stat: skip: Branch protection. (Not an AArch64 binary). Hardened: stat: FAIL: Parts of the binary were compiled without sufficient -fcf-protection. Hardened: stat: PASS: One dynamic section/segment found. Hardened: stat: PASS: Entry point instruction is ENDBR. Hardened: stat: PASS: Compiled with -D_FORTIFY_SOURCE=2. Hardened: stat: PASS: Compiled with -D_GLIBCXX_ASSERTIONS. Hardened: stat: skip: Test for -Wl,-z,relro. (No dynamic relocations). Hardened: stat: PASS: Stack not executable. Hardened: stat: PASS: Compiled with sufficient optimization. Hardened: stat: PASS: Compiled with PIC/PIE. Hardened: stat: PASS: Compiled as a position independent binary. Hardened: stat: PASS: Good GNU Property note. Hardened: stat: PASS: DT_RPATH/DT_RUNPATH absent or rooted at /usr. Hardened: stat: PASS: No RWX segments found. Hardened: stat: PASS: Consistent use of the -fshort-enum option. Hardened: stat: FAIL: Parts of the binary were compiled without stack clash protection. Hardened: stat: PASS: Compiled with sufficient stack protection. Hardened: stat: skip: Test for stack realignment support. (Only needed on i686 binaries). Hardened: stat: PASS: No text relocations found. Hardened: stat: PASS: No thread cancellation problems. Hardened: stat: PASS: Compiled with either -Wall and/or -Wformat-security. Hardened: stat: PASS: GOT/PLT relocations are read only. 8.5 Server x86_64 #