Bug 2135901 - find-provides.ksyms generates bogus output
Summary: find-provides.ksyms generates bogus output
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel-srpm-macros
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eugene Syromiatnikov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2135047
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-18 17:15 UTC by Eugene Syromiatnikov
Modified: 2024-05-21 14:19 UTC (History)
7 users (show)

Fixed In Version:
Clone Of: 2135047
Environment:
Last Closed: 2024-05-21 14:19:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Eugene Syromiatnikov 2022-10-18 17:15:19 UTC
+++ This bug was initially created as a clone of Bug #2135047 +++

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

--- Additional comment from Eugene Syromiatnikov on 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 1 Ben Cotton 2023-02-07 15:10:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Aoife Moloney 2024-05-07 15:51:07 UTC
This message is a reminder that Fedora Linux 38 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 38 on 2024-05-21.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '38'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 38 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 3 Aoife Moloney 2024-05-21 14:19:37 UTC
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.