Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1678986

Re: [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier

From Edward Cree <ecree@solarflare.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier
Date 2017-06-30 18:50 +0200
Message-ID <tY7hf-7Sv-3@gated-at.bofh.it> (permalink)
References <tWYg2-C4-5@gated-at.bofh.it> <tXlFF-7uy-33@gated-at.bofh.it> <tXlYZ-7Qx-1@gated-at.bofh.it> <tXs4q-2d9-27@gated-at.bofh.it> <tXsQO-v0-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 28/06/17 22:37, Alexei Starovoitov wrote:
> Increasing the limit is must have, since pruning suffered so much.
> Going from 53k to 76k is pretty substantial.
> What is the % increase for tests in selftests/ ?
When I tried to measure the test_verifier tests, they changed hardly at
 all, only a couple of percent iirc.  But that's with (a) only the
 accepted progs get measured, since rejected don't print the #insns line
 - and most of the tests in test_verifier are rejected; and (b) those
 test progs are pretty small, usually with only a couple of jumps and
 not much chance for pruning to occur.  So it's really not a great test
 case for pruning effectiveness.
I haven't measured the test_progs ones, because I *still* haven't gotten
 around to actually setting up a BPF toolchain (it doesn't help that I'm
 building everything on a test server that gets reimaged every night to
 run our nightly tests...).
> I think we need to pin point exactly the reason.
> Saying we just track more data is not enough.
> We've tried v2 set on our load balancer and also saw ~20% increase.
> I don't remember the absolute numbers.
> These jumps don't make me comfortable with these extra tracking.
> Can you try to roll back ptr&const and full negative/positive tracking
> and see whether it gets back to what we had before?
The ptr&const bit shouldn't be relevant unless your programs are actually
 doing that (i.e. ops on pointers other than +/-), which seems surprising.
 But if you really are, then it's not too hard to roll it back - just
 need to change how adjust_reg_min_max_vals() deals with EACCES.
For a version without full negative/positive tracking, just take the first
 3 patches; some of the selftests will fail but hopefully your progs will
 still be accepted.  If not, we can try jbacik's patch (off-list response
 to v2).  I will followup this email with a patch to apply on top of the
 first 3 that does that and rolls back ptr&const.
> If tnum is causing it that would be reasonable trade off to make,
> but if it's full neg/pos tracking that has no use today other than
> (the whole thing is cleaner) I would rather drop it then.
Well, the full neg/pos tracking was a result of needing to fix the bug I
 found with patch #1, and not wanting to confuse myself with the min/max
 range while doing my signed/unsigned tracking.  But if we can make it
 work with jbacik's approach of 'remember whether our current bounds came
 from a signed or an unsigned compare', then we can drop or delay the
 full neg/pos tracking unless/until pruning is sorted out.

-Ed

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier Edward Cree <ecree@solarflare.com> - 2017-06-27 15:00 +0200
  [PATCH v3 net-next 06/12] selftests/bpf: change test_verifier  expectations Edward Cree <ecree@solarflare.com> - 2017-06-27 15:00 +0200
  [PATCH v3 net-next 03/12] nfp: change bpf verifier hooks to match new  verifier data structures Edward Cree <ecree@solarflare.com> - 2017-06-27 15:00 +0200
    Re: [PATCH v3 net-next 03/12] nfp: change bpf verifier hooks to match  new verifier data structures Daniel Borkmann <daniel@iogearbox.net> - 2017-06-28 22:50 +0200
    Re: [PATCH v3 net-next 03/12] nfp: change bpf verifier hooks to  match new verifier data structures Jakub Kicinski <jakub.kicinski@netronome.com> - 2017-06-29 05:50 +0200
  [PATCH v3 net-next 01/12] selftests/bpf: add test for mixed signed  and unsigned bounds checks Edward Cree <ecree@solarflare.com> - 2017-06-27 15:00 +0200
    Re: [PATCH v3 net-next 01/12] selftests/bpf: add test for mixed signed  and unsigned bounds checks Daniel Borkmann <daniel@iogearbox.net> - 2017-06-28 16:00 +0200
  [PATCH v3 net-next 07/12] selftests/bpf: rewrite test_align Edward Cree <ecree@solarflare.com> - 2017-06-27 15:00 +0200
  [PATCH v3 net-next 09/12] selftests/bpf: add test for bogus  operations on pointers Edward Cree <ecree@solarflare.com> - 2017-06-27 15:10 +0200
  [PATCH v3 net-next 12/12] selftests/bpf: variable offset negative  tests Edward Cree <ecree@solarflare.com> - 2017-06-27 15:10 +0200
  [PATCH v3 net-next 08/12] selftests/bpf: add a test to test_align Edward Cree <ecree@solarflare.com> - 2017-06-27 15:10 +0200
  [PATCH v3 net-next 10/12] selftests/bpf: don't try to access past  MAX_PACKET_OFF in test_verifier Edward Cree <ecree@solarflare.com> - 2017-06-27 15:10 +0200
  [PATCH v3 net-next 11/12] selftests/bpf: add tests for subtraction &  negative numbers Edward Cree <ecree@solarflare.com> - 2017-06-27 15:10 +0200
  Re: [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier Daniel Borkmann <daniel@iogearbox.net> - 2017-06-28 16:00 +0200
    Re: [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier Edward Cree <ecree@solarflare.com> - 2017-06-28 16:20 +0200
      Re: [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier Daniel Borkmann <daniel@iogearbox.net> - 2017-06-28 22:50 +0200
        Re: [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2017-06-28 23:40 +0200
          Re: [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier Edward Cree <ecree@solarflare.com> - 2017-06-30 18:50 +0200
            [TEST PATCH] bpf/verifier: roll back ptr&const handling, and fix  signed bounds Edward Cree <ecree@solarflare.com> - 2017-06-30 19:40 +0200
  Re: [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking Daniel Borkmann <daniel@iogearbox.net> - 2017-06-28 17:20 +0200
    Re: [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking Edward Cree <ecree@solarflare.com> - 2017-06-28 18:10 +0200
      Re: [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking Daniel Borkmann <daniel@iogearbox.net> - 2017-06-28 21:50 +0200
  Re: [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking Daniel Borkmann <daniel@iogearbox.net> - 2017-06-28 20:00 +0200
    Re: [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking Edward Cree <ecree@solarflare.com> - 2017-06-28 20:30 +0200

csiph-web