Bug 2039080 - libbpf: errno 524 is returned when bpf_create_map_xattr() call fails
Summary: libbpf: errno 524 is returned when bpf_create_map_xattr() call fails
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: libbpf
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Viktor Malik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker
TreeView+ depends on / blocked
 
Reported: 2022-01-10 21:40 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2022-12-13 16:17 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-13 16:17:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2022-01-10 21:40:35 UTC
Description of problem:
As described in https://bugzilla.redhat.com/show_bug.cgi?id=2036145#c7:

bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH_OF_MAPS, key_size=8, value_size=4, max_entries=2048, map_flags=0, inner_map_fd=3<anon_inode:bpf-map>, map_name="cgroup_hash", map_ifindex=0, btf_fd=4<anon_inode:btf>, btf_key_type_id=6, btf_value_type_id=10, btf_vmlinux_value_type_id=0}, 120) = -1 ENOTSUPP (Unknown error 524)
write(2<pipe:[8562394]>, "libbpf: Error in bpf_create_map_"..., 107libbpf: Error in bpf_create_map_xattr(cgroup_hash):ERROR: strerror_r(-524)=22(-524). Retrying without BTF.
) = 107
bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH_OF_MAPS, key_size=8, value_size=4, max_entries=2048, map_flags=0, inner_map_fd=3<anon_inode:bpf-map>, map_name="cgroup_hash", map_ifindex=0, btf_fd=0</dev/pts/4>, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 120) = 5<anon_inode:bpf-map>
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=6, insns=0x7ffeb2f682f0, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0</dev/pts/4>, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0</dev/pts/4>}, 120) = 6<anon_inode:bpf-prog>
close(6<anon_inode:bpf-prog>)           = 0

Version-Release number of selected component (if applicable):
kernel-core-5.15.11-200.fc35.aarch64
libbpf-0.4.0-2.fc35.aarch64

But also s390x and other places where arch_prepare_bpf_trampoline() is missing.


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jeremy Linton 2022-04-26 16:22:24 UTC
It seems this (or a similar problem) is causing a number of ugly boot messages in F36:

[   10.664453] systemd[1]: Failed to open libbpf, LSM BPF is not supported: Operation not supported
[   13.889291] systemd[1]: systemd v250.3-8.fc36 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[   14.242905] systemd[1]: Failed to link BPF program. Assuming BPF is not available

 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: libbpf: Error in bpf_object__probe_loading():Operation not permitted(1). Couldn't load trivial BPF pr>
Apr 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: libbpf: failed to load object 'socket_bind_bpf'
Apr 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: libbpf: failed to load BPF skeleton 'socket_bind_bpf': -1
Apr 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: libbpf: Error in bpf_object__probe_loading():Operation not permitted(1). Couldn't load trivial BPF pr>
Apr 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: libbpf: failed to load object 'restrict_ifaces_bpf'
Apr 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: libbpf: failed to load BPF skeleton 'restrict_ifaces_bpf': -1
Apr 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: Failed to load BPF object: Operation not permitted
Apr 26 16:06:22 ip-10-253-132-89.ec2.internal systemd[798]: Failed to create BPF map: Operation not permitted

Comment 2 Viktor Malik 2022-04-29 07:46:50 UTC
I wonder what the actual problem is here. BPF LSM requires arch_prepare_bpf_trampoline() which is not supported on non-x86 arches, hence the errno (524 is ENOTSUPP).

Comment 3 Zbigniew Jędrzejewski-Szmek 2022-05-16 06:10:12 UTC
(In reply to Viktor Malik from comment #2)
> I wonder what the actual problem is here. BPF LSM requires
> arch_prepare_bpf_trampoline() which is not supported on non-x86 arches,
> hence the errno (524 is ENOTSUPP).

Hmm, why 524? EOPNOTSUPP is 95 on amd64 and also on arm64. I don't have an s390x machine handy,
but I'd assume the same.

Comment 4 Ben Cotton 2022-11-29 17:37:58 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
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 '35'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 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 5 Ben Cotton 2022-12-13 16:17:28 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 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.