aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/linker.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2021-11-24 00:23:14 +0000
committerDaniel Borkmann <[email protected]>2021-11-25 23:14:06 +0000
commit401891a9debaf0a684502f2aaecf53448cee9414 (patch)
tree0aa7859715d0c72758e24fe0d0665f5adad02528 /tools/lib/bpf/linker.c
parenttools/resolve_btf_ids: Close ELF file on error (diff)
downloadkernel-401891a9debaf0a684502f2aaecf53448cee9414.tar.gz
kernel-401891a9debaf0a684502f2aaecf53448cee9414.zip
libbpf: Fix potential misaligned memory access in btf_ext__new()
Perform a memory copy before we do the sanity checks of btf_ext_hdr. This prevents misaligned memory access if raw btf_ext data is not 4-byte aligned ([0]). While at it, also add missing const qualifier. [0] Closes: https://github.com/libbpf/libbpf/issues/391 Fixes: 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections") Reported-by: Evgeny Vereshchagin <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/linker.c')
0 files changed, 0 insertions, 0 deletions