]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: add btf_dedup test of FWD/STRUCT resolution
authorAndrii Nakryiko <andriin@fb.com>
Thu, 28 Feb 2019 23:31:25 +0000 (15:31 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Mar 2019 00:31:48 +0000 (01:31 +0100)
commit6d3d6a05b9285cbbdc4268eb78555b368e4ca6c4
tree4c448c63fd71c34c6eb9c606f13a6662ab07170b
parentf4532e3cc9eb93647fd8c4c9fb30beac8341da77
selftests/bpf: add btf_dedup test of FWD/STRUCT resolution

This patch adds a btf_dedup test exercising logic of STRUCT<->FWD
resolution and validating that STRUCT is not resolved to a FWD. It also
forces hash collisions, forcing both FWD and STRUCT to be candidates for
each other. Previously this condition caused infinite loop due to FWD
pointing to STRUCT and STRUCT pointing to its FWD.

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_btf.c