Re: [PATCH net-next 3/4] bpf/verifier: when pruning a branch, ignore its write marks

2017-08-22 Thread Alexei Starovoitov
On 8/22/17 11:03 AM, Edward Cree wrote: On 22/08/17 16:50, Edward Cree wrote: On 22/08/17 16:24, Alexei Starovoitov wrote: Do you have a test case for this by any chance? I think something like if (cond) r0=0; if (cond) r0=0; return r0; might tickle the bug, but I'm

Re: [PATCH net-next 3/4] bpf/verifier: when pruning a branch, ignore its write marks

2017-08-22 Thread Edward Cree
On 22/08/17 16:50, Edward Cree wrote: > On 22/08/17 16:24, Alexei Starovoitov wrote: >> Do you have a test case for this by any chance? > I think something like > if (cond) > r0=0; > if (cond) > r0=0; > return r0; > might tickle the bug, but I'm not sure. It turns out th

Re: [PATCH net-next 3/4] bpf/verifier: when pruning a branch, ignore its write marks

2017-08-22 Thread Edward Cree
On 22/08/17 16:24, Alexei Starovoitov wrote: > On 8/22/17 6:27 AM, Edward Cree wrote: >> The fact that writes occurred in reaching the continuation state does >> not screen off its reads from us, because we're not really its parent. >> So detect 'not really the parent' in do_propagate_liveness, an

Re: [PATCH net-next 3/4] bpf/verifier: when pruning a branch, ignore its write marks

2017-08-22 Thread Alexei Starovoitov
On 8/22/17 6:27 AM, Edward Cree wrote: The fact that writes occurred in reaching the continuation state does not screen off its reads from us, because we're not really its parent. So detect 'not really the parent' in do_propagate_liveness, and ignore write marks in that case. Fixes: dc503a8ad9

[PATCH net-next 3/4] bpf/verifier: when pruning a branch, ignore its write marks

2017-08-22 Thread Edward Cree
The fact that writes occurred in reaching the continuation state does not screen off its reads from us, because we're not really its parent. So detect 'not really the parent' in do_propagate_liveness, and ignore write marks in that case. Fixes: dc503a8ad984 ("bpf/verifier: track liveness for pru