From: Daniel Borkmann <daniel@iogearbox.net>
To: Jiong Wang <jiong.wang@netronome.com>, ast@kernel.org
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com
Subject: Re: [PATCH bpf-next] bpf: correct slot_type marking logic to allow more stack slot sharing
Date: Tue, 18 Dec 2018 23:28:34 +0100 [thread overview]
Message-ID: <9c1d60cd-281b-1223-a7dd-aff142410fd0@iogearbox.net> (raw)
In-Reply-To: <1544862880-23291-1-git-send-email-jiong.wang@netronome.com>
On 12/15/2018 09:34 AM, Jiong Wang wrote:
> Verifier is supposed to support sharing stack slot allocated to ptr with
> SCALAR_VALUE for privileged program. However this doesn't happen for some
> cases.
>
> The reason is verifier is not clearing slot_type STACK_SPILL for all bytes,
> it only clears part of them, while verifier is using:
>
> slot_type[0] == STACK_SPILL
>
> as a convention to check one slot is ptr type.
>
> So, the consequence of partial clearing slot_type is verifier could treat a
> partially overridden ptr slot, which should now be a SCALAR_VALUE slot,
> still as ptr slot, and rejects some valid programs.
>
> Before this patch, test_xdp_noinline.o under bpf selftests, bpf_lxc.o and
> bpf_netdev.o under Cilium bpf repo, when built with -mattr=+alu32 are
> rejected due to this issue. After this patch, they all accepted.
>
> There is no processed insn number change before and after this patch on
> Cilium bpf programs.
>
> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Daniel Borkmann <daniel@iogearbox.net>
next prev parent reply other threads:[~2018-12-18 22:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-15 8:34 [PATCH bpf-next] bpf: correct slot_type marking logic to allow more stack slot sharing Jiong Wang
2018-12-18 22:28 ` Daniel Borkmann [this message]
2018-12-18 22:48 ` Alexei Starovoitov
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=9c1d60cd-281b-1223-a7dd-aff142410fd0@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=ast@kernel.org \
--cc=jiong.wang@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/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