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 2044858

Summary: annocheck FAIL: bind-now test (fio)
Product: Red Hat Enterprise Linux 9 Reporter: Rui Ormonde <rlemosor>
Component: fioAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: Samuel Petrovic <spetrovi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: jhladky, spetrovi
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fio-3.27-7.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 14:09:51 UTC Type: ---
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: 2044387    

Description Rui Ormonde 2022-01-25 10:29:53 UTC
Failed test: bind-now test

Test results:
\n Hardened: fio-dev-dax.so: FAIL: bind-now test because not linked with -Wl'-z'now

Applicable RPMs:
fio-engine-dev-dax-3.27-4.el9.ppc64le.rpm; fio-engine-dev-dax-3.27-4.el9.x86_64.rpm; fio-engine-http-3.27-4.el9.aarch64.rpm; fio-engine-http-3.27-4.el9.ppc64le.rpm; fio-engine-http-3.27-4.el9.s390x.rpm; fio-engine-http-3.27-4.el9.x86_64.rpm; fio-engine-libaio-3.27-4.el9.aarch64.rpm; fio-engine-libaio-3.27-4.el9.ppc64le.rpm; fio-engine-libaio-3.27-4.el9.s390x.rpm; fio-engine-libaio-3.27-4.el9.x86_64.rpm; fio-engine-libpmem-3.27-4.el9.ppc64le.rpm; fio-engine-libpmem-3.27-4.el9.x86_64.rpm; fio-engine-nbd-3.27-4.el9.aarch64.rpm; fio-engine-nbd-3.27-4.el9.ppc64le.rpm; fio-engine-nbd-3.27-4.el9.s390x.rpm; fio-engine-nbd-3.27-4.el9.x86_64.rpm; fio-engine-pmemblk-3.27-4.el9.ppc64le.rpm; fio-engine-pmemblk-3.27-4.el9.x86_64.rpm; fio-engine-rados-3.27-4.el9.aarch64.rpm; fio-engine-rados-3.27-4.el9.ppc64le.rpm; fio-engine-rados-3.27-4.el9.s390x.rpm; fio-engine-rados-3.27-4.el9.x86_64.rpm; fio-engine-rbd-3.27-4.el9.aarch64.rpm; fio-engine-rbd-3.27-4.el9.ppc64le.rpm; fio-engine-rbd-3.27-4.el9.s390x.rpm; fio-engine-rbd-3.27-4.el9.x86_64.rpm; fio-engine-rdma-3.27-4.el9.aarch64.rpm; fio-engine-rdma-3.27-4.el9.ppc64le.rpm; fio-engine-rdma-3.27-4.el9.s390x.rpm; fio-engine-rdma-3.27-4.el9.x86_64.rpm

Recommendation: Please fix the build system for the package or else add a skip of tests to the rpminspect.yaml file. For more details please see https://sourceware.org/annobin/annobin.html/Test-bind-now.html and https://sourceware.org/annobin/annobin.html/Waiving-Hardened-Results.html#Waiving-Hardened-Results.

Why this bug was filed: All packages in RHEL 9 built with gcc (g++, etc.) are required to use a common set of flags provided by the distribution. These flags turn on important security and performance features so it is critical that any package that lacks these flags be repaired. A scanning tool named annocheck, part of the annobin package, was used to scan RHEL 9 packages. This BZ was created because binary packages of this component with the mentioned NVRs were not built with the requisite flags for one or more RHEL 9 architectures.

How to reproduce the failure: You could try running annocheck locally against your builds: https://developers.redhat.com/blog/2019/02/04/annocheck-examining-the-contents-of-binary-files.

Annocheck resources:
* annobin documentation: https://sourceware.org/annobin/annobin.html/index.html
* annocheck on the customer portal: https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/9/html/user_guide/chap-annobin

Contacts:
* Instant messaging: #tools on IRC
* Email: use tools for generic questions. Otherwise, use go-tools and llvm-clang-list for Go and Clang/LLVM specific questions.
* annobin-annocheck maintainer: Nick Clifton (nickc)

Comment 2 Eric Sandeen 2022-01-25 18:02:49 UTC
I think this can be fixed by simply including $(LDFLAGS) appropriately in the Makefile:

--- a/Makefile.orig	2022-01-25 10:20:26.862377137 -0600
+++ b/Makefile	2022-01-25 10:20:30.061327891 -0600
@@ -287,7 +287,7 @@
 $(1)_OBJS := $$($(1)_SRCS:.c=.o)
 $$($(1)_OBJS): CFLAGS := -fPIC $$($(1)_CFLAGS) $(CFLAGS)
 engines/fio-$(1).so: $$($(1)_OBJS)
-	$$(QUIET_LINK)$(CC) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS)
+	$$(QUIET_LINK)$(CC) $(LDFLAGS) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS)
 ENGS_OBJS += engines/fio-$(1).so
 endef
 else # !CONFIG_DYNAMIC_ENGINES

Comment 3 Eric Sandeen 2022-02-04 18:38:41 UTC
This is upstream now.

https://git.kernel.dk/cgit/fio/commit/?id=2b3d4a6a924e0aa82654d3b96fb134085af7a98a

Comment 4 Eric Sandeen 2022-02-04 18:57:40 UTC
Hi Samuel, I'd like to fix this one for 9.0.0 - if you agree can you set qe_ack? I already set a DTM but feel free to change it.

Thanks,
-Eric

Comment 6 Eric Sandeen 2022-02-09 16:31:39 UTC
It took longer to achieve the change than I expected so moving DTM out by one.

However, to verify this (get it into verified-tested?) it should be simple enough; just looking at the build logs we now see the proper hardening flags which were not there before.

Before:

http://download.eng.bos.redhat.com/brewroot/packages/fio/3.27/4.el9/data/logs/x86_64/build.log

gcc -shared -rdynamic -fPIC -Wl,-soname,fio-nbd.so.1 -o engines/fio-nbd.so engines/nbd.o -lnbd 
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-libaio.so.1 -o engines/fio-libaio.so engines/libaio.o -laio
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-rdma.so.1 -o engines/fio-rdma.so engines/rdma.o -libverbs -lrdmacm
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-rados.so.1 -o engines/fio-rados.so engines/rados.o -lrados
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-rbd.so.1 -o engines/fio-rbd.so engines/rbd.o -lrbd -lrados
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-http.so.1 -o engines/fio-http.so engines/http.o -lcurl -lssl -lcrypto
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-pmemblk.so.1 -o engines/fio-pmemblk.so engines/pmemblk.o -lpmemblk
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-dev-dax.so.1 -o engines/fio-dev-dax.so engines/dev-dax.o -lpmem
gcc -shared -rdynamic -fPIC -Wl,-soname,fio-libpmem.so.1 -o engines/fio-libpmem.so engines/libpmem.o -lpmem

After:

http://download.eng.bos.redhat.com/brewroot/packages/fio/3.27/7.el9/data/logs/x86_64/build.log

gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-nbd.so.1 -o engines/fio-nbd.so engines/nbd.o -lnbd 
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-libaio.so.1 -o engines/fio-libaio.so engines/libaio.o -laio
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-rdma.so.1 -o engines/fio-rdma.so engines/rdma.o -libverbs -lrdmacm
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-rados.so.1 -o engines/fio-rados.so engines/rados.o -lrados
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-rbd.so.1 -o engines/fio-rbd.so engines/rbd.o -lrbd -lrados
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-http.so.1 -o engines/fio-http.so engines/http.o -lcurl -lssl -lcrypto
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-pmemblk.so.1 -o engines/fio-pmemblk.so engines/pmemblk.o -lpmemblk
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-dev-dax.so.1 -o engines/fio-dev-dax.so engines/dev-dax.o -lpmem
gcc -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -rdynamic -shared -rdynamic -fPIC -Wl,-soname,fio-libpmem.so.1 -o engines/fio-libpmem.so engines/libpmem.o -lpmem

thanks,
-Eric

Comment 11 errata-xmlrpc 2022-05-17 14:09:51 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: fio), 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-2022:2659