]> git.ipfire.org Git - thirdparty/systemd.git/commit
bpf-program: check if a trivial BPF program can be created and loaded
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 23 May 2025 17:38:46 +0000 (02:38 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 27 May 2025 16:24:33 +0000 (17:24 +0100)
commitb6278c1937f68c0edacaf25966d8d683c62de3a5
treec2ce4e7fdd0070d8f94c9ba863ca24eb391a6f74
parenta8a39e23bbac065635b7fb3243ad2eaacef1cfd1
bpf-program: check if a trivial BPF program can be created and loaded

Re-introduce the check dropped by
ec3c5cfac74e8361a3b0153cc9e8cfdbbcbde0c6,
ad446c8ceb97c03971f06fd43e97720afe33be5a.

For some reasons, if we are running on LXC, even if bpf_program_supported()
returned true, but bpf_program_load_kernel() failed:
```
Attaching device control BPF program to cgroup /system.slice/test-bpf-devices-875b406d56ac7bc3.scope/186c411f6e991777 failed: Operation not permitted
src/test/test-bpf-devices.c:31: Assertion failed: Expected "r" to succeed, but got error: Operation not permitted
```
src/shared/bpf-program.c