anthraxx / linux-hardened

Minimal supplement to upstream Kernel Self Protection Project changes. Features already provided by SELinux + Yama and archs other than multiarch arm64 / x86_64 aren't in scope. Only tags have stable history. Shared IRC channel with KSPP: irc.libera.chat #linux-hardening
Other
554 stars 55 forks source link

After update to >=5.16.17: "libbpf: failed to find valid kernel BTF" #67

Closed manfred3000 closed 2 years ago

manfred3000 commented 2 years ago

OS: Arch Linux uname -r: 5.16.17-hardened1-1-hardened Kernel parameters: "rw root=UUID=xyz initrd=intel-ucode.img initrd=initramfs-%v.img quiet splash sysrq_always_enabled=1 lsm=landlock,lockdown,yama,apparmor,bpf"

After the latest update I get the following message on boot:

libbpf: failed to find valid kernel BTF
libbpf: Error loading vmlinux BTF: -3
libbpf: failed to load object 'iterators_bpf'
libbpf: failed to load BPF skeleton 'iterators_bpf': -3
Failed load could be due to wrong endianness

I gather that this occurred before

I'm running pure wayland (wlroots-based stuff) and haven't encountered any issues so far...

EDIT: There is no /sys/kernel/btf/vmlinux on my system.

deathtrip commented 2 years ago

I have the same warnings. It seems the solution is in the previous bug report.

Disabling CONFIG_BPF_PRELOAD gets rid of those warnings. It seems to be a debug related option so disabling it makes sense while CONFIG_DEBUG_INFO is disabled at the same time.

Bernhard40 commented 2 years ago

I think you should report this to Arch bugtracker as its packaging bug unrelated to linux-hardened patches.

manfred3000 commented 2 years ago

I think you should report this to Arch bugtracker as its packaging bug unrelated to linux-hardened patches.

@anthraxx

anthraxx commented 2 years ago

This is indeed not an issue within the code here, but with the Kconfig choices in arch. However, it should be fixed with the latest Arch package release by disabling CONFIG_BPF_PRELOAD

manfred3000 commented 2 years ago

I haven't abandoned this issue - on my end, the error message is still present...

~ ❯ uname -r                                                    [0] 22:12
5.17.12-hardened2-1-hardened
anthraxx commented 2 years ago

@manfred3000 right, I've just modified CONFIG_BPF_PRELOAD in the 5.18 testing configs, however please open an Arch issue for packaging related problems :cat:

manfred3000 commented 2 years ago

Got it. I was under the impression that there was/is one already: https://bugs.archlinux.org/task/69155?string=hardened&project=1&type%5B0%5D=&sev%5B0%5D=&pri%5B0%5D=&due%5B0%5D=&reported%5B0%5D=&cat%5B0%5D=&status%5B0%5D=open&percent%5B0%5D=&opened=&dev=&closed=&duedatefrom=&duedateto=&changedfrom=&changedto=&openedfrom=&openedto=&closedfrom=&closedto=