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()
[ Upstream commit 401891a ] 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 Fixes: 2993e05 ("tools/bpf: add support to read .BTF.ext sections") Reported-by: Evgeny Vereshchagin <evvers@ya.ru> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20211124002325.1737739-3-andrii@kernel.org Signed-off-by: Sasha Levin <sashal@kernel.org>
- Loading branch information