1
0
Fork 0
alistair23-linux/tools/bpf
Toke Høiland-Jørgensen 83cc18a0c2 bpftool: Don't crash on missing jited insns or ksyms
[ Upstream commit 5b79bcdf03 ]

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: 71bb428fe2 ("tools: bpf: add bpftool")
Fixes: f84192ee00 ("tools: bpftool: resolve calls without using imm field")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191210181412.151226-1-toke@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-12 12:21:24 +01:00
..
bpftool bpftool: Don't crash on missing jited insns or ksyms 2020-01-12 12:21:24 +01:00
.gitignore tools: bpf: account for generated feature/ and libbpf/ directories 2019-08-31 00:38:16 +02:00
Makefile tools, bpf: Fix build for 'make -s tools/bpf O=<dir>' 2019-12-31 16:45:47 +01:00
Makefile.helpers treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
bpf_asm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 232 2019-06-19 17:09:06 +02:00
bpf_dbg.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 232 2019-06-19 17:09:06 +02:00
bpf_exp.l bpf: fix cbpf parser bug for octal numbers 2018-06-03 07:46:55 -07:00
bpf_exp.y tools: rename tools/net directory to tools/bpf 2017-10-04 21:45:05 -07:00
bpf_jit_disasm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 232 2019-06-19 17:09:06 +02:00