bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: John Fastabend <john.fastabend@gmail.com>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: <yhs@fb.com>, <daniel@iogearbox.net>, <netdev@vger.kernel.org>,
Subject: Re: [RFC PATCH 2/4] bpf: verifier, do explicit u32 bounds tracking
Date: Tue, 10 Mar 2020 19:41:21 +0000	[thread overview]
Message-ID: <1e714857-f92c-947f-f3d6-d525f45c3d68@solarflare.com> (raw)
In-Reply-To: <5e67e977eb4f_586d2b10f16785b8f5@john-XPS-13-9370.notmuch>

On 10/03/2020 19:24, John Fastabend wrote:
> I guess I'm not opposed to supporting (a) it seems like it should
> be doable.
Ah ok.  Indeed if we add u32 bounds we get (a) for free, I just
 wasn't sure it was reason enough by itself to justify them.

> For (b) the primary reason is to keep symmetry between 32-bit and
> 64-bit cases. But also we could have mixed signed 32-bit comparisons
> which this helps with.
> Example tracking bounds with [x,y] being signed 32-bit
> bounds and [x',y'] being unsigned 32-bit bounds.
>     r1 = #                   [x,y],[x',y']
>     w1 >    0 goto pc+y      [x,y],[1 ,y']
>     w1 s> -10 goto pc+x      [-10,y],[1 ,y']
> We can't really deduce much from that in __reg_deduce_bounds so
> we get stuck with different bounds on signed and unsigned space.
> Same case as 64-bit world fwiw. I guess we could do more work
> and use 64-bit/32-bit together and deduce something
Ah ok, problem is when you have good u32 bounds but know nothing
 about the high 32, so your u64 bounds don't capture those u32
 bounds.  I think I get it now and I agree that u32 bounds are
 worth doing :-)


  reply	other threads:[~2020-03-10 19:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-07  0:10 [RFC bpf PATCH 0/4] rfc for 32-bit subreg verifier tracking John Fastabend
2020-03-07  0:10 ` [RFC PATCH 1/4] bpf: verifer, refactor adjust_scalar_min_max_vals John Fastabend
2020-03-07  0:11 ` [RFC PATCH 2/4] bpf: verifier, do explicit u32 bounds tracking John Fastabend
2020-03-07  0:22   ` John Fastabend
2020-03-09  5:39     ` Yonghong Song
2020-03-09 23:58   ` Alexei Starovoitov
2020-03-10 17:04     ` John Fastabend
2020-03-10 17:12     ` Edward Cree
2020-03-10 19:24       ` John Fastabend
2020-03-10 19:41         ` Edward Cree [this message]
2020-03-10 17:52   ` Yonghong Song
2020-03-10 19:54     ` John Fastabend
2020-03-07  0:11 ` [RFC PATCH 3/4] bpf: verifier, do_refine_retval_range may clamp umin to 0 incorrectly John Fastabend
2020-03-07  0:11 ` [RFC PATCH 4/4] bpf: selftests, bpf_get_stack return value add <0 John Fastabend

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e714857-f92c-947f-f3d6-d525f45c3d68@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \


* 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).