]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix logic for finding matching program for CO-RE relocation
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 26 Apr 2022 00:45:04 +0000 (17:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 26 Apr 2022 22:41:46 +0000 (15:41 -0700)
commitf97ba0d2e94cf87a4abf4bc1f31795869cc64adb
tree9ee96d3f6f87ae09ba75e67b5be0790fc612b763
parente76f9f4a4d6b497891a0b6a8875d279e9a63d94a
libbpf: Fix logic for finding matching program for CO-RE relocation

Fix the bug in bpf_object__relocate_core() which can lead to finding
invalid matching BPF program when processing CO-RE relocation. IF
matching program is not found, last encountered program will be assumed
to be correct program and thus error detection won't detect the problem.

Fixes: ee48a326e023 ("libbpf: Fix CO-RE relocs against .text section")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220426004511.2691730-4-andrii@kernel.org
tools/lib/bpf/libbpf.c