linux/tools/lib
Andrii Nakryiko 8fb436d146 libbpf: Fix BTF data layout checks and allow empty BTF
[ Upstream commit d8123624506cd62730c9cd9c7672c698e462703d ]

Make data section layout checks stricter, disallowing overlap of types and
strings data.

Additionally, allow BTFs with no type data. There is nothing inherently wrong
with having BTF with no types (put potentially with some strings). This could
be a situation with kernel module BTFs, if module doesn't introduce any new
type information.

Also fix invalid offset alignment check for btf->hdr->type_off.

Fixes: 8a138aed4a ("bpf: btf: Add BTF support to libbpf")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201105043402.2530976-8-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-17 09:48:39 +01:00
..
api tools api fs: Make xxx__mountpoint() more scalable 2020-06-22 09:30:58 +02:00
bpf libbpf: Fix BTF data layout checks and allow empty BTF 2021-11-17 09:48:39 +01:00
lockdep
subcmd
symbol
traceevent tools lib traceevent: Fix memory leak in process_dynamic_array_len 2020-08-11 15:33:38 +02:00
argv_split.c
bitmap.c
ctype.c
find_bit.c
hweight.c
rbtree.c
str_error_r.c
string.c
vsprintf.c
zalloc.c