public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Daniel Borkmann via iovisor-dev <iovisor-dev-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public•gmane.org>
To: Edward Cree <ecree-s/n/eUQHGBpZroRs9YW3xA@public•gmane.org>,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public•gmane.org,
	Alexei Starovoitov
	<alexei.starovoitov-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>,
	Alexei Starovoitov <ast-b10kYP2dOMg@public•gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	iovisor-dev
	<iovisor-dev-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public•gmane.org>
Subject: Re: [PATCH v2 net-next 1/5] selftests/bpf: add a test for a bug in liveness-based pruning
Date: Wed, 23 Aug 2017 16:42:51 +0200	[thread overview]
Message-ID: <599D946B.7070207@iogearbox.net> (raw)
In-Reply-To: <83dbbb0c-3cbc-e033-0ceb-f31db6eb57c2-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>

On 08/23/2017 04:09 PM, Edward Cree wrote:
> Writes in straight-line code should not prevent reads from propagating
>   along jumps.  With current verifier code, the jump from 3 to 5 does not
>   add a read mark on 3:R0 (because 5:R0 has a write mark), meaning that
>   the jump from 1 to 3 gets pruned as safe even though R0 is NOT_INIT.
>
> Verifier output:
> 0: (61) r2 = *(u32 *)(r1 +0)
> 1: (35) if r2 >= 0x0 goto pc+1
>   R1=ctx(id=0,off=0,imm=0) R2=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R10=fp0
> 2: (b7) r0 = 0
> 3: (35) if r2 >= 0x0 goto pc+1
>   R0=inv0 R1=ctx(id=0,off=0,imm=0) R2=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R10=fp0
> 4: (b7) r0 = 0
> 5: (95) exit
>
> from 3 to 5: safe
>
> from 1 to 3: safe
> processed 8 insns, stack depth 0
>
> Signed-off-by: Edward Cree <ecree-s/n/eUQHGBpZroRs9YW3xA@public•gmane.org>

Acked-by: Daniel Borkmann <daniel-FeC+5ew28dpmcu3hnIyYJQ@public•gmane.org>

  parent reply	other threads:[~2017-08-23 14:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 14:07 [PATCH v2 net-next 0/5] bpf: verifier fixes Edward Cree via iovisor-dev
2017-08-23 14:09 ` [PATCH v2 net-next 1/5] selftests/bpf: add a test for a bug in liveness-based pruning Edward Cree
     [not found]   ` <83dbbb0c-3cbc-e033-0ceb-f31db6eb57c2-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
2017-08-23 14:42     ` Daniel Borkmann via iovisor-dev [this message]
2017-08-23 14:43     ` Alexei Starovoitov via iovisor-dev
     [not found] ` <f9208b68-466e-c6cb-4d0c-c567e40bdc15-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
2017-08-23 14:10   ` [PATCH v2 net-next 2/5] bpf/verifier: when pruning a branch, ignore its write marks Edward Cree via iovisor-dev
     [not found]     ` <ec2ee579-8391-c023-348a-770faa6bc5c7-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
2017-08-23 14:42       ` Alexei Starovoitov via iovisor-dev
2017-08-23 14:56     ` Daniel Borkmann
2017-08-23 14:10   ` [PATCH v2 net-next 3/5] selftests/bpf: add a test for a pruning bug in the verifier Edward Cree via iovisor-dev
2017-08-23 14:43     ` Daniel Borkmann
2017-08-23 14:10   ` [PATCH v2 net-next 4/5] bpf/verifier: remove varlen_map_value_access flag Edward Cree via iovisor-dev
     [not found]     ` <34d97e19-2de8-d336-ba13-77d3b02c5f20-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
2017-08-23 14:41       ` Alexei Starovoitov via iovisor-dev
2017-08-23 14:44     ` Daniel Borkmann
2017-08-23 14:11 ` [PATCH v2 net-next 5/5] bpf/verifier: document liveness analysis Edward Cree
     [not found]   ` <3d4870a2-d7ee-2ac0-aaed-a9faeae89b9e-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
2017-08-23 14:41     ` Alexei Starovoitov via iovisor-dev
2017-08-23 14:57     ` Daniel Borkmann via iovisor-dev
2017-08-24  5:38 ` [PATCH v2 net-next 0/5] bpf: verifier fixes David Miller

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=599D946B.7070207@iogearbox.net \
    --to=iovisor-dev-9jonkmmolfhee9la1f8ukti2o/jbrioy@public$(echo .)gmane.org \
    --cc=alexei.starovoitov-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=ast-b10kYP2dOMg@public$(echo .)gmane.org \
    --cc=daniel-FeC+5ew28dpmcu3hnIyYJQ@public$(echo .)gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public$(echo .)gmane.org \
    --cc=ecree-s/n/eUQHGBpZroRs9YW3xA@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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