Re: [PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-16 Thread Jann Horn
On Wed, Nov 16, 2016 at 9:25 PM, Josef Bacik wrote: > On 11/16/2016 01:41 PM, Jann Horn wrote: >> >> On Tue, Nov 15, 2016 at 3:20 PM, Josef Bacik wrote: >>> >>> On 11/15/2016 08:47 AM, Jann Horn wrote: In states_equal(): if (rold->type == NOT_INIT || (rold->type == UNKNOWN_

Re: [PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-16 Thread Josef Bacik
On 11/16/2016 01:41 PM, Jann Horn wrote: On Tue, Nov 15, 2016 at 3:20 PM, Josef Bacik wrote: On 11/15/2016 08:47 AM, Jann Horn wrote: In states_equal(): if (rold->type == NOT_INIT || (rold->type == UNKNOWN_VALUE && rcur->type != NOT_INIT)) < continue; I think this is broken in

Re: [PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-16 Thread Jann Horn
On Tue, Nov 15, 2016 at 3:20 PM, Josef Bacik wrote: > On 11/15/2016 08:47 AM, Jann Horn wrote: >> In states_equal(): >> if (rold->type == NOT_INIT || >>(rold->type == UNKNOWN_VALUE && rcur->type != NOT_INIT)) >> < >> continue; >> >> I think this is broken in code like the following

Re: [PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-16 Thread David Miller
From: Josef Bacik Date: Mon, 14 Nov 2016 15:45:36 -0500 > I made some invalid assumptions with BPF_AND and BPF_MOD that could result in > invalid accesses to bpf map entries. Fix this up by doing a few things > > 1) Kill BPF_MOD support. This doesn't actually get used by the compiler in > rea

Re: [PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-15 Thread Josef Bacik
On 11/15/2016 08:47 AM, Jann Horn wrote: On Tue, Nov 15, 2016 at 4:10 AM, Alexei Starovoitov wrote: On Mon, Nov 14, 2016 at 03:45:36PM -0500, Josef Bacik wrote: I made some invalid assumptions with BPF_AND and BPF_MOD that could result in invalid accesses to bpf map entries. Fix this up by do

Re: [PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-15 Thread Jann Horn
On Tue, Nov 15, 2016 at 4:10 AM, Alexei Starovoitov wrote: > On Mon, Nov 14, 2016 at 03:45:36PM -0500, Josef Bacik wrote: >> I made some invalid assumptions with BPF_AND and BPF_MOD that could result in >> invalid accesses to bpf map entries. Fix this up by doing a few things >> >> 1) Kill BPF_MO

Re: [PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-14 Thread Alexei Starovoitov
On Mon, Nov 14, 2016 at 03:45:36PM -0500, Josef Bacik wrote: > I made some invalid assumptions with BPF_AND and BPF_MOD that could result in > invalid accesses to bpf map entries. Fix this up by doing a few things > > 1) Kill BPF_MOD support. This doesn't actually get used by the compiler in >

[PATCH net][v2] bpf: fix range arithmetic for bpf map access

2016-11-14 Thread Josef Bacik
I made some invalid assumptions with BPF_AND and BPF_MOD that could result in invalid accesses to bpf map entries. Fix this up by doing a few things 1) Kill BPF_MOD support. This doesn't actually get used by the compiler in real life and just adds extra complexity. 2) Fix the logic for BPF_AND,