]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libbpf: Fix accessing BTF.ext core_relo header
authorTony Ambardar <tony.ambardar@gmail.com>
Sat, 25 Jan 2025 06:52:36 +0000 (22:52 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 3 Feb 2025 11:33:51 +0000 (03:33 -0800)
commit0a7c2a84359612e54328aa52030eb202093da6e2
treef072b7033a9fc64527e0c677221ab885a06990b8
parenta63a631c9b5cb25a1c17dd2cb18c63df91e978b1
libbpf: Fix accessing BTF.ext core_relo header

Update btf_ext_parse_info() to ensure the core_relo header is present
before reading its fields. This avoids a potential buffer read overflow
reported by the OSS Fuzz project.

Fixes: cf579164e9ea ("libbpf: Support BTF.ext loading and output in either endianness")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://issues.oss-fuzz.com/issues/388905046
Link: https://lore.kernel.org/bpf/20250125065236.2603346-1-itugrok@yahoo.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/btf.c