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 2135047

Summary: find-provides.ksyms generates bogus output
Product: Red Hat Enterprise Linux 9 Reporter: Igor Raits <igor.raits>
Component: kernel-srpm-macrosAssignee: Eugene Syromiatnikov <esyr>
Status: CLOSED ERRATA QA Contact: Ziqian SUN (Zamir) <zsun>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, jwboyer, zsun
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-srpm-macros-1.0-12.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2135901 (view as bug list) Environment:
Last Closed: 2023-05-09 07:54:04 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: 2135901    
Attachments:
Description Flags
vringh.ko.xz none

Description Igor Raits 2022-10-15 15:30:49 UTC
Created attachment 1918242 [details]
vringh.ko.xz

Description of problem:
After https://bugzilla.redhat.com/show_bug.cgi?id=2055464, the new provides start to be generated but they are quite broken for some of the modules. I'll attach specific one in attachment.

Version-Release number of selected component (if applicable):
binutils-2.35.2-24.el9.x86_64
kernel-rpm-macros-185-11.el9.noarch

How reproducible:
Always.

Steps to Reproduce:
1. Grab example of module that is attached
2. echo /builddir/build/BUILDROOT/kernel-6.0.1-1.gdc.el9.x86_64/lib/modules/6.0.1-1.gdc.el9.x86_64/kernel/drivers/vhost/vringh.ko.xz | bash -x /usr/lib/rpm/redhat/find-provides.ksyms

Actual results:
Many bogus Provides…
ksym(vringh_init_user) = 0x6e697276
ksym(vringh_iov_pull_iotlb) = 0x625f6867
ksym(vringh_iov_pull_kern) = 0xvr006461
ksym(vringh_iov_pull_user) = 0xad_bghin
ksym(vringh_iov_push_iotlb) = 0x       .
ksym(vringh_iov_push_kern) = 0x        
ksym(vringh_iov_push_user) = 0x        
ksym(vringh_kiov_advance) = 0x        
ksym(vringh_need_notify_iotlb) = 0x        
ksym(vringh_need_notify_kern) = 0x        
ksym(vringh_need_notify_user) = 0x        
ksym(vringh_notify_disable_iotlb) = 0x        
ksym(vringh_notify_disable_kern) = 0x        
ksym(vringh_notify_disable_user) = 0x        
ksym(vringh_notify_enable_iotlb) = 0x        
ksym(vringh_notify_enable_kern) = 0x        
ksym(vringh_notify_enable_user) = 0x        
ksym(vringh_set_iotlb) = 0x        

Expected results:
No bogus Provides, only good ones.

Additional info:
<mock-chroot> sh-5.1# echo /builddir/build/BUILDROOT/kernel-6.0.1-1.gdc.el9.x86_64/lib/modules/6.0.1-1.gdc.el9.x86_64/kernel/drivers/vhost/vringh.ko.xz | bash -x /usr/lib/rpm/redhat/find-provides.ksyms
+ IFS='
'
++ grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$'
+ for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"
+ dep_pfx=ksym
+ printf %s /builddir/build/BUILDROOT/kernel-6.0.1-1.gdc.el9.x86_64/lib/modules/6.0.1-1.gdc.el9.x86_64/kernel/drivers/vhost/vringh.ko.xz
+ grep -v '^/\?lib/modules/[1-9][^/]*/kernel'
+ tmpfile=
+ '[' x/builddir/build/BUILDROOT/kernel-6.0.1-1.gdc.el9.x86_64/lib/modules/6.0.1-1.gdc.el9.x86_64/kernel/drivers/vhost/vringh.ko.xz = x/builddir/build/BUILDROOT/kernel-6.0.1-1.gdc.el9.x86_64/lib/modules/6.0.1-1.gdc.el9.x86_64/kernel/drivers/vhost/vringh.ko.xz ']'
++ mktemp -t find-provides.ksyms.XXXXXX.ko
+ tmpfile=/tmp/find-provides.ksyms.L6PeV2.ko
+ proc_bin=
+ case "${module##*.}" in
+ proc_bin=xz
+ '[' -n xz ']'
+ xz -d -c -
+ module=/tmp/find-provides.ksyms.L6PeV2.ko
++ nm /tmp/find-provides.ksyms.L6PeV2.ko
++ sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):0x\1 \2:p'
+ [[ -n '' ]]
++ readelf -R .rodata /tmp/find-provides.ksyms.L6PeV2.ko
++ awk '/0x/{printf $2$3$4$5}'
+ ELFRODATA=000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000000000007672696e67685f62616400vringh_bad.
++ readelf -h /tmp/find-provides.ksyms.L6PeV2.ko
++ grep 'little endian'
+ [[ -n   Data:                              2's complement, little endian ]]
++ echo 000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000000000007672696e67685f62616400vringh_bad.
++ sed 's/\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/g'
+ RODATA=000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ awk --non-decimal-data '{printf("ksym(%s) = 0x%08s\n", $2, substr($3,($1*2)+1,8))}'
+ LC_ALL=C
+ sort -u
++ nm /tmp/find-provides.ksyms.L6PeV2.ko
++ sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p'
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x0 vringh_abandon_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x4 vringh_abandon_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x8 vringh_abandon_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0xc vringh_complete_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x10 vringh_complete_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x14 vringh_complete_multi_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x18 vringh_complete_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x1c vringh_getdesc_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x20 vringh_getdesc_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x24 vringh_getdesc_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x28 vringh_init_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x2c vringh_init_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x30 vringh_init_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x34 vringh_iov_pull_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x38 vringh_iov_pull_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x3c vringh_iov_pull_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x40 vringh_iov_push_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x44 vringh_iov_push_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x48 vringh_iov_push_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x4c vringh_kiov_advance' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x50 vringh_need_notify_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x54 vringh_need_notify_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x58 vringh_need_notify_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x5c vringh_notify_disable_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x60 vringh_notify_disable_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x64 vringh_notify_disable_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x68 vringh_notify_enable_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x6c vringh_notify_enable_kern' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x70 vringh_notify_enable_user' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
+ for sym in $(nm $module | sed -r -ne 's:^0*([0-9a-f]+) [DR] __crc_(.+):0x\1 \2:p')
+ echo '0x74 vringh_set_iotlb' 000000000000000000000030000000000000001b000000000000001f00000000000000000000000000000000000000006e697276625f6867vr006461ad_bghin.
ksym(vringh_abandon_iotlb) = 0x00000000
ksym(vringh_abandon_kern) = 0x00000000
ksym(vringh_abandon_user) = 0x00000030
ksym(vringh_complete_iotlb) = 0x00000000
ksym(vringh_complete_kern) = 0x0000001b
ksym(vringh_complete_multi_user) = 0x00000000
ksym(vringh_complete_user) = 0x0000001f
ksym(vringh_getdesc_iotlb) = 0x00000000
ksym(vringh_getdesc_kern) = 0x00000000
ksym(vringh_getdesc_user) = 0x00000000
ksym(vringh_init_iotlb) = 0x00000000
ksym(vringh_init_kern) = 0x00000000
ksym(vringh_init_user) = 0x6e697276
ksym(vringh_iov_pull_iotlb) = 0x625f6867
ksym(vringh_iov_pull_kern) = 0xvr006461
ksym(vringh_iov_pull_user) = 0xad_bghin
ksym(vringh_iov_push_iotlb) = 0x       .
ksym(vringh_iov_push_kern) = 0x        
ksym(vringh_iov_push_user) = 0x        
ksym(vringh_kiov_advance) = 0x        
ksym(vringh_need_notify_iotlb) = 0x        
ksym(vringh_need_notify_kern) = 0x        
ksym(vringh_need_notify_user) = 0x        
ksym(vringh_notify_disable_iotlb) = 0x        
ksym(vringh_notify_disable_kern) = 0x        
ksym(vringh_notify_disable_user) = 0x        
ksym(vringh_notify_enable_iotlb) = 0x        
ksym(vringh_notify_enable_kern) = 0x        
ksym(vringh_notify_enable_user) = 0x        
ksym(vringh_set_iotlb) = 0x        
+ '[' -z /tmp/find-provides.ksyms.L6PeV2.ko ']'
+ rm -f -- /tmp/find-provides.ksyms.L6PeV2.ko

Comment 1 Eugene Syromiatnikov 2022-10-18 17:14:07 UTC
The breakage has been introduced by upstream Linux commit v5.19-rc1~139^2~2 ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS") that broke the assumption about the placement of non-absolute CRC symbols in .rodata and is not observed in the RHEL 9 kernel so far.

Comment 11 errata-xmlrpc 2023-05-09 07:54:04 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 (kernel-srpm-macros 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:2420