diff options
author | Edward Cree <ecree@solarflare.com> | 2017-09-26 17:35:29 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-28 19:23:18 +0200 |
commit | 73c864b38383f4abc9b559025cd663f4a81afa89 (patch) | |
tree | b728e14e460b2a53546bdb27e39507714b7701fa /kernel | |
parent | bpf/verifier: improve disassembly of BPF_END instructions (diff) | |
download | linux-73c864b38383f4abc9b559025cd663f4a81afa89.tar.xz linux-73c864b38383f4abc9b559025cd663f4a81afa89.zip |
bpf/verifier: improve disassembly of BPF_NEG instructions
BPF_NEG takes only one operand, unlike the bulk of BPF_ALU[64] which are
compound-assignments. So give it its own format in print_bpf_insn().
Signed-off-by: Edward Cree <ecree@solarflare.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/verifier.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index e8d7bb8e6b98..4cf9b72c59a0 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -351,6 +351,11 @@ static void print_bpf_insn(const struct bpf_verifier_env *env, verbose("BUG_alu64_%02x\n", insn->code); else print_bpf_end_insn(env, insn); + } else if (BPF_OP(insn->code) == BPF_NEG) { + verbose("(%02x) r%d = %s-r%d\n", + insn->code, insn->dst_reg, + class == BPF_ALU ? "(u32) " : "", + insn->dst_reg); } else if (BPF_SRC(insn->code) == BPF_X) { verbose("(%02x) %sr%d %s %sr%d\n", insn->code, class == BPF_ALU ? "(u32) " : "", |