Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: libbpf/libbpf#391 Reported-by: Evgeny Vereshchagin <evvers@ya.ru> Fixes: 2993e05 ("tools/bpf: add support to read .BTF.ext sections") Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
- Loading branch information
Showing
2 changed files
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters