From: Alexei Starovoitov Date: Fri, 1 Dec 2017 05:31:35 +0000 (-0800) Subject: bpf: fix stack state printing in verifier log X-Git-Tag: v4.19~1702^2~431^2~2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12a3cc8424fe1237aaeb982dec4f0914ddd22f3e;p=platform%2Fkernel%2Flinux-rpi3.git bpf: fix stack state printing in verifier log fix incorrect stack state prints in print_verifier_state() Fixes: 638f5b90d460 ("bpf: reduce verifier memory consumption") Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Daniel Borkmann Signed-off-by: Daniel Borkmann --- diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index d459357..71a9429f 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -279,7 +279,7 @@ static void print_verifier_state(struct bpf_verifier_env *env, for (i = 0; i < state->allocated_stack / BPF_REG_SIZE; i++) { if (state->stack[i].slot_type[0] == STACK_SPILL) verbose(env, " 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(env, "\n");