Skip to content

libbpf: avoid overflow in BTF.ext bounds check - #8690

Closed
kernel-patches-daemon-bpf-rc[bot] wants to merge 1 commit into
bpf-next_basefrom
series/1143651=>bpf-next
Closed

libbpf: avoid overflow in BTF.ext bounds check#8690
kernel-patches-daemon-bpf-rc[bot] wants to merge 1 commit into
bpf-next_basefrom
series/1143651=>bpf-next

Conversation

@kernel-patches-daemon-bpf-rc

Copy link
Copy Markdown

Pull request for series with
subject: libbpf: avoid overflow in BTF.ext bounds check
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1143651

An invalid BTF.ext subsection length can wrap the pointer addition used by
btf_ext_parse_sec_info() on 32-bit builds. The wrapped pointer passes the
bounds check and parsing then reads beyond the copied BTF.ext data.

Validate the offset and length with subtraction before forming the section
pointer. Add a selftest using an overflowing func_info_len.

Fixes: cf57916 ("libbpf: Support BTF.ext loading and output in either endianness")

Closes: https://issues.oss-fuzz.com/issues/477315119
Signed-off-by: Darren Carreras <carrerasdarren@gmail.com>
@kernel-patches-daemon-bpf-rc

Copy link
Copy Markdown
Author

Upstream branch: d114bb9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1143651
version: 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant