]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Ignore incompatible types with matching name during CO-RE relocation
authorAndrii Nakryiko <andriin@fb.com>
Fri, 13 Mar 2020 17:23:34 +0000 (10:23 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Mar 2020 22:30:53 +0000 (23:30 +0100)
commit51b8faaca5a1d9d6e277632a0a5539df44f977d7
treecd25234c8e4096105993a9b4432d1f13ca59c044
parent88903c42b75a1d35f294c8bad964ea340300bb2f
libbpf: Ignore incompatible types with matching name during CO-RE relocation

When finding target type candidates, ignore forward declarations, functions,
and other named types of incompatible kind. Not doing this can cause false
errors.  See [0] for one such case (due to struct pt_regs forward
declaration).

  [0] https://github.com/iovisor/bcc/pull/2806#issuecomment-598543645

Fixes: 299b4e30e1c4 ("libbpf: implement BPF CO-RE offset relocation algorithm")
Reported-by: Wenbo Zhang <ethercflow@gmail.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200313172336.1879637-3-andriin@fb.com
tools/lib/bpf/libbpf.c