diff options
author | Andrii Nakryiko | 2020-08-18 15:39:15 -0700 |
---|---|---|
committer | Alexei Starovoitov | 2020-08-18 18:12:45 -0700 |
commit | 353c788c2054257359114f12827d86f8e3332e10 (patch) | |
tree | 76da039698fb3c846183f722e82f3d03c854200d /mm/mprotect.c | |
parent | 28b93c64499ae09d9dc8c04123b15f8654a93c4c (diff) |
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 <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200818223921.2911963-4-andriin@fb.com
Diffstat (limited to 'mm/mprotect.c')
0 files changed, 0 insertions, 0 deletions