]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpftool: fix potential NULL pointer dereferencing in prog_dump()
authorAmir Mohammadi <amirmohammadi1999.am@gmail.com>
Thu, 21 Nov 2024 08:34:13 +0000 (12:04 +0330)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:29 +0000 (19:51 +0100)
commit2bd350f0e74cd8b279ba6ea901fd82c7e173e26a
tree851772c3842b43d4cdc2163f024bd2bd5c86df43
parentca906853f6c70c769ac93f9e9b4dedb506de1f3c
bpftool: fix potential NULL pointer dereferencing in prog_dump()

[ Upstream commit ef3ba8c258ee368a5343fa9329df85b4bcb9e8b5 ]

A NULL pointer dereference could occur if ksyms
is not properly checked before usage in the prog_dump() function.

Fixes: b053b439b72a ("bpf: libbpf: bpftool: Print bpf_line_info during prog dump")
Signed-off-by: Amir Mohammadi <amiremohamadi@yahoo.com>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20241121083413.7214-1-amiremohamadi@yahoo.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/bpf/bpftool/prog.c