]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Don't crash on missing xlated program instructions
authorToke Høiland-Jørgensen <toke@redhat.com>
Thu, 6 Feb 2020 10:29:06 +0000 (11:29 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 7 Feb 2020 21:29:45 +0000 (22:29 +0100)
commit07155464f849853fdc673319f7d2a711cdd83f3b
tree51b5933cf72754517120706d152f3205285512f3
parentf387be394383aa5a1f8db2912fbcab05d1ee93a8
bpftool: Don't crash on missing xlated program instructions

Turns out the xlated program instructions can also be missing if
kptr_restrict sysctl is set. This means that the previous fix to check the
jited_prog_insns pointer was insufficient; add another check of the
xlated_prog_insns pointer as well.

Fixes: 7ff3995b6e18 ("bpftool: Don't crash on missing jited insns or ksyms")
Fixes: f007a2f8d7e3 ("bpftool: use bpf_program__get_prog_info_linear() in prog.c:do_dump()")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20200206102906.112551-1-toke@redhat.com
tools/bpf/bpftool/prog.c