[J][SRU][PATCH 0/1] Fix bpf build failure on Jammy

Po-Hsu Lin po-hsu.lin at canonical.com
Fri Sep 15 09:13:28 UTC 2023


BugLink: https://bugs.launchpad.net/bugs/2035181

[Impact]
Commit bdeeed3498c7 ("libbpf: fix offsetof() and container_of() to work
with CO-RE") from stable update breaks the ubuntu_bpf test build and
cause net:udpgro_bench.sh, net:udpgro.sh, net:veth.sh in
ubuntu_kernel_selftests stopped working, as they require bpf selftest
to be built first.

The following is extracted from the commit message:
The problem is the new offsetof() does not play nice with static asserts.
Given that the context is a static assert (and CO-RE relocation is not
needed at compile time), offsetof() usage can be replaced by restoring
the original offsetof() definition as __builtin_offsetof().

[Test Plan]
Build bpf selftest in tools/testing/selftests with the following command:
make headers; make -C tools/testing/selftests TARGETS=bpf SKIP_TARGETS= \
clean all KDIR=/usr/src/linux-headers-5.15.0-85-generic/

The build can finish successfully with patched kernel source code.

[Where problems could occur]
Fix limited to testing tool, if this fix is incorrect the bpf selftest
build will remain broken.


Alan Maguire (1):
  selftests/bpf: fix static assert compilation issue for test_cls_*.c

 tools/testing/selftests/bpf/progs/test_cls_redirect.h | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.7.4




More information about the kernel-team mailing list