Commit 50fcaa71 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Greg Kroah-Hartman
Browse files

libbpf: Fix BTF header parsing checks



[ Upstream commit c825f5fe ]

Original code assumed fixed and correct BTF header length. That's not
always the case, though, so fix this bug with a proper additional check.
And use actual header length instead of sizeof(struct btf_header) in
sanity checks.

Fixes: 8a138aed ("bpf: btf: Add BTF support to libbpf")
Reported-by: default avatarEvgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211023003157.726961-2-andrii@kernel.org


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 12872fd7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment