From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann via iovisor-dev 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 Message-ID: <599D946B.7070207@iogearbox.net> References: <83dbbb0c-3cbc-e033-0ceb-f31db6eb57c2@solarflare.com> Reply-To: Daniel Borkmann Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iovisor-dev To: Edward Cree , davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, Alexei Starovoitov , Alexei Starovoitov Return-path: In-Reply-To: <83dbbb0c-3cbc-e033-0ceb-f31db6eb57c2-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iovisor-dev-bounces-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public.gmane.org Errors-To: iovisor-dev-bounces-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public.gmane.org List-Id: netdev.vger.kernel.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 Acked-by: Daniel Borkmann