aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/bpf_prog_linfo.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2020-08-18 22:39:15 +0000
committerAlexei Starovoitov <[email protected]>2020-08-19 01:12:45 +0000
commit353c788c2054257359114f12827d86f8e3332e10 (patch)
tree76da039698fb3c846183f722e82f3d03c854200d /tools/lib/bpf/bpf_prog_linfo.c
parentlibbpf: Clean up and improve CO-RE reloc logging (diff)
downloadkernel-353c788c2054257359114f12827d86f8e3332e10.tar.gz
kernel-353c788c2054257359114f12827d86f8e3332e10.zip
libbpf: Improve relocation ambiguity detection
Split the instruction patching logic into relocation value calculation and application of relocation to instruction. Using this, evaluate relocation against each matching candidate and validate that all candidates agree on relocated value. If not, report ambiguity and fail load. This logic is necessary to avoid dangerous (however unlikely) accidental match against two incompatible candidate types. Without this change, libbpf will pick a random type as *the* candidate and apply potentially invalid relocation. Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf_prog_linfo.c')
0 files changed, 0 insertions, 0 deletions