linux-stable/tools
Andrii Nakryiko 91097fbee4 btf: fix bug with resolving STRUCT/UNION into corresponding FWD
When checking available canonical candidates for struct/union algorithm
utilizes btf_dedup_is_equiv to determine if candidate is suitable. This
check is not enough when candidate is corresponding FWD for that
struct/union, because according to equivalence logic they are
equivalent. When it so happens that FWD and STRUCT/UNION end in hashing
to the same bucket, it's possible to create remapping loop from FWD to
STRUCT and STRUCT to same FWD, which will cause btf_dedup() to loop
forever.

This patch fixes the issue by additionally checking that type and
canonical candidate are strictly equal (utilizing btf_equal_struct).

Fixes: d5caef5b56 ("btf: add BTF types deduplication algorithm")
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-03-01 01:31:48 +01:00
..
accounting
arch powerpc fixes for 5.0 #3 2019-01-19 05:55:42 +12:00
bpf tools: libbpf: add a correctly named define for map iteration 2019-03-01 00:53:45 +01:00
build
cgroup
crypto
firewire
firmware
gpio
hv
iio
include tools/bpf: sync bpf.h into tools 2019-02-27 17:22:51 +01:00
kvm/kvm_stat
laptop
leds
lib btf: fix bug with resolving STRUCT/UNION into corresponding FWD 2019-03-01 01:31:48 +01:00
memory-model
nfsd
objtool
pci
pcmcia
perf tools: libbpf: add a correctly named define for map iteration 2019-03-01 00:53:45 +01:00
power
scripts
spi
testing selftests/bpf: fix btf_dedup testing code 2019-03-01 01:31:47 +01:00
thermal/tmon
time
usb
virtio
vm
wmi
Makefile