mbox series

[bpf-next,v2,0/3] libbpf: fix fuzzer-reported issues

Message ID 20221012022353.7350-1-shung-hsi.yu@suse.com (mailing list archive)
Headers show
Series libbpf: fix fuzzer-reported issues | expand

Message

Shung-Hsi Yu Oct. 12, 2022, 2:23 a.m. UTC
Hi, this patch set fixes several fuzzer-reported issues of libbpf when
dealing with (malformed) BPF object file:

- patch #1 fix out-of-bound heap write reported by oss-fuzz (currently
  incorrectly marked as fixed)

- patch #2 and #3 fix null-pointer dereference found by locally-run
  fuzzer.

v2:
- Rebase to bpf-next
- Move elf_getshdrnum() closer to where it's result is used in patch #1, as
  suggested by Andrii
  - Touch up the comment in bpf_object__elf_collect(), replacing mention of
    e_shnum with elf_getshdrnum()
- Minor wording change in commit message of patch #1 to for better readability
- Remove extra note that comes after commit message in patch #1

v1: https://lore.kernel.org/bpf/20221007174816.17536-1-shung-hsi.yu@suse.com/

Shung-Hsi Yu (3):
  libbpf: use elf_getshdrnum() instead of e_shnum
  libbpf: deal with section with no data gracefully
  libbpf: fix null-pointer dereference in find_prog_by_sec_insn()

 tools/lib/bpf/libbpf.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)


base-commit: 0326074ff4652329f2a1a9c8685104576bd8d131
--
2.37.3

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 13, 2022, 4 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Wed, 12 Oct 2022 10:23:50 +0800 you wrote:
> Hi, this patch set fixes several fuzzer-reported issues of libbpf when
> dealing with (malformed) BPF object file:
> 
> - patch #1 fix out-of-bound heap write reported by oss-fuzz (currently
>   incorrectly marked as fixed)
> 
> - patch #2 and #3 fix null-pointer dereference found by locally-run
>   fuzzer.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/3] libbpf: use elf_getshdrnum() instead of e_shnum
    https://git.kernel.org/bpf/bpf-next/c/ea306bb65ff8
  - [bpf-next,v2,2/3] libbpf: deal with section with no data gracefully
    https://git.kernel.org/bpf/bpf-next/c/662e24598d8c
  - [bpf-next,v2,3/3] libbpf: fix null-pointer dereference in find_prog_by_sec_insn()
    https://git.kernel.org/bpf/bpf-next/c/79d0ca2d19bf

You are awesome, thank you!