twx-linux/tools
Andrii Nakryiko bdeeed3498 libbpf: fix offsetof() and container_of() to work with CO-RE
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 <lennart@poettering.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230509065502.2306180-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-05-12 12:05:21 -07:00
..
accounting
arch Networking changes for 6.4. 2023-04-26 16:07:23 -07:00
bootconfig
bpf bpftool: Dump map id instead of value for map_of_maps types 2023-04-27 13:26:34 -07:00
build
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include Networking changes for 6.4. 2023-04-26 16:07:23 -07:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: fix offsetof() and container_of() to work with CO-RE 2023-05-12 12:05:21 -07:00
memory-model LKMM scripting updates for v6.4 2023-04-24 12:02:25 -07:00
mm slab changes for 6.4 2023-04-25 13:00:41 -07:00
net/ynl tools: ynl: Rename ethtool to ethtool.py 2023-04-13 22:18:29 -07:00
objtool for-6.4-tag 2023-04-26 09:13:44 -07:00
pci
pcmcia
perf
power Power management updates for 6.4-rc1 2023-04-25 18:44:10 -07:00
rcu
scripts
spi
testing selftests/bpf: Accept mem from dynptr in helper funcs 2023-05-06 16:42:58 -07:00
thermal
time
tracing
usb
verification
virtio tools/virtio: fix typo in README instructions 2023-04-04 11:01:58 -04:00
wmi
Makefile tools/Makefile: do missed s/vm/mm/ 2023-04-18 14:22:12 -07:00