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


Groups > linux.kernel > #1689275

Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking

From Edward Cree <ecree@solarflare.com>
Newsgroups linux.kernel
Subject Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking
Date 2017-07-17 19:10 +0200
Message-ID <u4hGW-7SW-29@gated-at.bofh.it> (permalink)
References (2 earlier) <u0mvx-2IA-27@gated-at.bofh.it> <u0BNU-4Ks-13@gated-at.bofh.it> <u0Fy9-7g2-11@gated-at.bofh.it> <u2vl0-3O6-5@gated-at.bofh.it> <u2xZv-5w6-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/07/17 23:07, Nadav Amit wrote:
> Edward Cree <ecree@solarflare.com> wrote:
>> In this specific case, there was a bug before: if (say) src and dst were
>> both unknown bytes (so range 0 to 255), it would compute the new min and max
>> to be 0, so it would think the result is known to be 0.  But that's wrong,
>> because it could be anything from -255 to +255.  The bug's implications are
>> that it could be used to construct an out-of-range offset to (say) a map
>> pointer which the verifier would think was in-range and thus accept.
> This sounds like a serious bug that may need to be backported to stable
> versions, no? In this case I would assume it should be in a separate patch
> so it could be applied separately.
Having looked deeper into this in attempting to create a test that the existing
 verifier would fail, it turns out that in the existing verifier that BPF_SUB
 handling is dead code.  If (for instance) we subtract an UNKNOWN_VALUE from a
 PTR_TO_MAP_VALUE_ADJ, that code will be run, but afterwards we will
 mark_reg_unknown_value() the register (bottom of check_alu_op()) making our
 previous min/max determination irrelevant.
So there's nothing to backport, and if I did change this in its own patch,
 there'd be no way to test it.  (I have, however, added a test covering this
 codepath in the new verifier.)

-Ed

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


Thread

Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework  value tracking Nadav Amit <nadav.amit@gmail.com> - 2017-07-06 23:30 +0200
  Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework  value tracking Edward Cree <ecree@solarflare.com> - 2017-07-07 15:50 +0200
    Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework  value tracking Nadav Amit <nadav.amit@gmail.com> - 2017-07-07 19:50 +0200
      Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework  value tracking Nadav Amit <nadav.amit@gmail.com> - 2017-07-08 03:00 +0200
      Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework  value tracking Edward Cree <ecree@solarflare.com> - 2017-07-12 21:20 +0200
        Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework  value tracking Nadav Amit <nadav.amit@gmail.com> - 2017-07-13 00:10 +0200
          Re: [iovisor-dev] [PATCH v3 net-next 02/12] bpf/verifier: rework  value tracking Edward Cree <ecree@solarflare.com> - 2017-07-17 19:10 +0200

csiph-web