Netdev List
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Jiong Wang <jiong.wang@netronome.com>
Cc: ast@kernel.org, daniel@iogearbox.net, 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 14:48:15 -0800	[thread overview]
Message-ID: <20181218224814.vjvxsob25xb5ko3f@ast-mbp> (raw)
In-Reply-To: <1544862880-23291-1-git-send-email-jiong.wang@netronome.com>

On Sat, Dec 15, 2018 at 03:34:40AM -0500, 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>

Applied, Thanks

      parent reply	other threads:[~2018-12-18 22:48 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
2018-12-18 22:48 ` Alexei Starovoitov [this message]

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=20181218224814.vjvxsob25xb5ko3f@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --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