]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix potential NULL dereference when parsing ELF
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 16 Aug 2022 00:19:26 +0000 (17:19 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 Aug 2022 20:42:10 +0000 (22:42 +0200)
commitc721fd8f8d1e1b96090dd732bb17a0dd2f6e27ce
tree91f8cd07ebb4fc28ca138dc381a61486ca1759f3
parent063eb6dfb21a3ad2e29382ada06263eb3eee9c31
libbpf: Fix potential NULL dereference when parsing ELF

Fix if condition filtering empty ELF sections to prevent NULL
dereference.

Fixes: 42e07760cba3 ("libbpf: Skip empty sections in bpf_object__init_global_data_maps")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Hao Luo <haoluo@google.com>
Link: https://lore.kernel.org/bpf/20220816001929.369487-2-andrii@kernel.org
tools/lib/bpf/libbpf.c