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.
Description of problem:
Trying to load an BPF object, which was fully stripped, using ip/libbpf fails with a SEGFAULT.
Version-Release number of selected component (if applicable):
iproute-5.15.0-2.el9.x86_64
libbpf-0.5.0-4.el9.x86_64
kernel-5.14.0-72.el9.x86_64
How reproducible:
Always
Steps to Reproduce:
This example is based on a BPF selftest failure. The behavior is very likely to occur in other places as well.
1. # cd /usr/libexec/kselftests/bpf
2. # ip link add dev veth0 type veth peer name veth1
3. # strip sample_map_ret0.o
4. # ip link set dev veth0 xdp obj sample_map_ret0.o sec .text verbose
Actual results:
libbpf: loading sample_map_ret0.o
libbpf: elf: section(1) .text, size 176, link 0, flags 6, type=1
Segmentation fault (core dumped)
Expected results:
Loading a fully stripped BPF file can not work but it should fail with a friendly error message.
Requires upstream commit:
03e601f48b2 libbpf: Don't crash on object files with no symbol tables
which should be pulled in as a part of BPF 5.16 rebase.
Tested on kernel 5.14.0-130.el9.x86_64
[root@netqe12 ~]# cd /usr/libexec/kselftests/bpf
[root@netqe12 bpf]# ip link add dev veth0 type veth peer name veth1
[root@netqe12 bpf]# strip sample_map_ret0.o
[root@netqe12 bpf]# ip link set dev veth0 xdp obj sample_map_ret0.o sec .text verbose
libbpf: loading sample_map_ret0.o
libbpf: elf: couldn't find symbol table in sample_map_ret0.o, stripped object file?
ERROR: opening BPF object file failed
The error msg looks more friendly.
Since the patch has already been merged by bpf update, so mark this as testOnly.
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 (libbpf 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-2022:8364