I just finished bisect between -1007 and -1008
ca6f352ba5c8ccde01289d433401f28e6c260e07 is the first bad commit
commit ca6f352ba5c8ccde01289d433401f28e6c260e07
Author: Andrii Nakryiko <[email protected]>
Date: Mon May 8 23:55:02 2023 -0700
libbpf: fix offsetof() and container_of() to work with CO-RE
BugLink: https://bugs.launchpad.net/bugs/2028528
[ Upstream commit bdeeed3498c7871c17465bb4f11d1bc67f9098af ]
It seems like __builtin_offset() doesn't preserve CO-RE field
relocations properly. So if offsetof() macro is defined through
__builtin_offset(), CO-RE-enabled BPF code using container_of() will be
subtly and silently broken.
To avoid this problem, redefine offsetof() and container_of() in the
form that works with CO-RE relocations more reliably.
Fixes: 5fbc220862fc ("tools/libpf: Add offsetof/container_of macro in
bpf_helpers.h")
Reported-by: Lennart Poettering <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Timo Aaltonen <[email protected]>
tools/lib/bpf/bpf_helpers.h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-oem-6.1 in Ubuntu.
https://bugs.launchpad.net/bugs/2028932
Title:
ubuntu_bpf failed to build with j-oem-6.1.0-1018.18
Status in ubuntu-kernel-tests:
New
Status in linux-oem-6.1 package in Ubuntu:
Invalid
Status in linux-oem-6.1 source package in Jammy:
New
Bug description:
Issue found with J-oem-6.1.0-1018.18
Test build failed with:
CLNG-BPF [test_maps] test_check_mtu.bpf.o
CLNG-BPF [test_maps] test_cls_redirect.bpf.o
make[1]: Leaving directory
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
make: Leaving directory
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
stderr:
progs/test_cls_redirect.c:90:2: error: static_assert expression is not an
integral constant expression
sizeof(flow_ports_t) !=
^~~~~~~~~~~~~~~~~~~~~~~
progs/test_cls_redirect.c:91:3: note: cast that performs the conversions of
a reinterpret_cast is not allowed in a constant expression
offsetofend(struct bpf_sock_tuple, ipv4.dport) -
^
progs/test_cls_redirect.c:32:3: note: expanded from macro 'offsetofend'
(offsetof(TYPE, MEMBER) + sizeof((((TYPE *)0)->MEMBER)))
^
/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:86:33:
note: expanded from macro 'offsetof'
#define offsetof(type, member) ((unsigned long)&((type *)0)->member)
^
progs/test_cls_redirect.c:95:2: error: static_assert expression is not an
integral constant expression
sizeof(flow_ports_t) !=
^~~~~~~~~~~~~~~~~~~~~~~
progs/test_cls_redirect.c:96:3: note: cast that performs the conversions of
a reinterpret_cast is not allowed in a constant expression
offsetofend(struct bpf_sock_tuple, ipv6.dport) -
^
progs/test_cls_redirect.c:32:3: note: expanded from macro 'offsetofend'
(offsetof(TYPE, MEMBER) + sizeof((((TYPE *)0)->MEMBER)))
^
/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:86:33:
note: expanded from macro 'offsetof'
#define offsetof(type, member) ((unsigned long)&((type *)0)->member)
^
2 errors generated.
make[1]: *** [Makefile:531:
/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/test_cls_redirect.bpf.o]
Error 1
make: *** [Makefile:160: all] Error 2
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/2028932/+subscriptions
--
Mailing list: https://launchpad.net/~kernel-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help : https://help.launchpad.net/ListHelp