From: Alexei Starovoitov <ast@fb.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
<netdev@vger.kernel.org>, <kernel-team@fb.com>
Subject: [PATCH net-next 1/7] bpf: fix stack state printing in verifier log
Date: Thu, 30 Nov 2017 21:31:35 -0800 [thread overview]
Message-ID: <20171201053141.3992592-2-ast@fb.com> (raw)
In-Reply-To: <20171201053141.3992592-1-ast@fb.com>
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>
---
kernel/bpf/verifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index d4593571c404..71a9429fdbb5 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");
--
2.9.5
next prev parent reply other threads:[~2017-12-01 5:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-01 5:31 [PATCH net-next 0/7] bpf: verifier improvements and cleanups Alexei Starovoitov
2017-12-01 5:31 ` Alexei Starovoitov [this message]
2017-12-01 5:31 ` [PATCH net-next 2/7] bpf: print liveness info to verifier log Alexei Starovoitov
2017-12-01 5:31 ` [PATCH net-next 3/7] bpf: don't mark FP reg as uninit Alexei Starovoitov
2017-12-01 5:31 ` [PATCH net-next 4/7] bpf: improve verifier liveness marks Alexei Starovoitov
2017-12-01 5:31 ` [PATCH net-next 5/7] bpf: improve JEQ/JNE path walking Alexei Starovoitov
2017-12-01 5:31 ` [PATCH net-next 6/7] bpf: cleanup register_is_null() Alexei Starovoitov
2017-12-01 5:31 ` [PATCH net-next 7/7] selftests/bpf: adjust test_align expected output Alexei Starovoitov
2017-12-01 10:28 ` [PATCH net-next 0/7] bpf: verifier improvements and cleanups Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171201053141.3992592-2-ast@fb.com \
--to=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).