projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b7c6ba
)
bpf/verifier: improve disassembly of BPF_NEG instructions
author
Edward Cree
<
[email protected]
>
Tue, 26 Sep 2017 15:35:29 +0000
(16:35 +0100)
committer
David S. Miller
<
[email protected]
>
Thu, 28 Sep 2017 17:23:18 +0000
(10:23 -0700)
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 <
[email protected]
>
Acked-by: Alexei Starovoitov <
[email protected]
>
Acked-by: Daniel Borkmann <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
kernel/bpf/verifier.c
patch
|
blob
|
history
diff --git
a/kernel/bpf/verifier.c
b/kernel/bpf/verifier.c
index e8d7bb8e6b9880e84b00eb9171171fa723a07ee4..4cf9b72c59a0615337c3b5855f42df4dacb70cd3 100644
(file)
--- 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) " : "",