Skip to content
Commit 16a3ace8 authored by Toke Høiland-Jørgensen's avatar Toke Høiland-Jørgensen Committed by Paul Gortmaker
Browse files

bpftool: Don't crash on missing jited insns or ksyms



commit 5b79bcdf upstream.

When the kptr_restrict sysctl is set, the kernel can fail to return
jited_ksyms or jited_prog_insns, but still have positive values in
nr_jited_ksyms and jited_prog_len. This causes bpftool to crash when
trying to dump the program because it only checks the len fields not
the actual pointers to the instructions and ksyms.

Fix this by adding the missing checks.

Fixes: 71bb428f ("tools: bpf: add bpftool")
Fixes: f84192ee ("tools: bpftool: resolve calls without using imm field")
Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191210181412.151226-1-toke@redhat.com


Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent b21074cc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment