bpftool: Fix bug for long instructions in program CFG dumps
authorQuentin Monnet <quentin@isovalent.com>
Wed, 5 Apr 2023 13:21:15 +0000 (14:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:21 +0000 (23:03 +0900)
commit81366e333c7e034cc2e86021f1e5accdfc37ab7f
tree910abe9b55a6cf072783a0b275946bf8ad7815a4
parentd199c2b3943e11d19b4201541f66051dfeb322e7
bpftool: Fix bug for long instructions in program CFG dumps

[ Upstream commit 67cf52cdb6c8fa6365d29106555dacf95c9fd374 ]

When dumping the control flow graphs for programs using the 16-byte long
load instruction, we need to skip the second part of this instruction
when looking for the next instruction to process. Otherwise, we end up
printing "BUG_ld_00" from the kernel disassembler in the CFG.

Fixes: efcef17a6d65 ("tools: bpftool: generate .dot graph from CFG information")
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/r/20230405132120.59886-3-quentin@isovalent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/bpf/bpftool/xlated_dumper.c