diff options
author | Alexei Starovoitov <ast@fb.com> | 2019-04-03 18:39:04 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-20 09:15:08 +0200 |
commit | 85614894812adb00ddd1eb3e4b18ddb995dd61c1 (patch) | |
tree | 6bf3e6b1615420a90beff9e522abde4c359e9928 /kernel | |
parent | 86e5dd8cced7b1bffdae6154a1a7826ed8acf1f4 (diff) | |
download | linux-stable-85614894812adb00ddd1eb3e4b18ddb995dd61c1.tar.gz linux-stable-85614894812adb00ddd1eb3e4b18ddb995dd61c1.tar.bz2 linux-stable-85614894812adb00ddd1eb3e4b18ddb995dd61c1.zip |
bpf: fix stack state printing in verifier log
commit 12a3cc8424fe1237aaeb982dec4f0914ddd22f3e upstream.
fix incorrect stack state prints in print_verifier_state()
Fixes: 638f5b90d460 ("bpf: reduce verifier memory consumption")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Balbir Singh <sblbir@amzn.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/verifier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 68ff8ee42ba0..84e0338be0ad 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -268,7 +268,7 @@ static void print_verifier_state(struct bpf_verifier_state *state) for (i = 0; i < state->allocated_stack / BPF_REG_SIZE; i++) { if (state->stack[i].slot_type[0] == STACK_SPILL) verbose(" fp%d=%s", - -MAX_BPF_STACK + i * BPF_REG_SIZE, + (-i - 1) * BPF_REG_SIZE, reg_type_str[state->stack[i].spilled_ptr.type]); } verbose("\n"); |