Re: [PATCH bpf-next] bpf: fix sock_map_alloc() error path

2018-02-13 Thread Alexei Starovoitov
On Tue, Feb 13, 2018 at 06:53:36PM -0800, John Fastabend wrote: > On 02/13/2018 05:19 PM, Daniel Borkmann wrote: > > Hi Eric, > > > > On 02/14/2018 12:43 AM, Eric Dumazet wrote: > >> On Tue, 2018-02-13 at 15:33 -0800, Eric Dumazet wrote: > >>> From: Eric Dumazet > >>> > >>> In case user program p

Re: [PATCH bpf-next] bpf: fix sock_map_alloc() error path

2018-02-13 Thread John Fastabend
On 02/13/2018 05:19 PM, Daniel Borkmann wrote: > Hi Eric, > > On 02/14/2018 12:43 AM, Eric Dumazet wrote: >> On Tue, 2018-02-13 at 15:33 -0800, Eric Dumazet wrote: >>> From: Eric Dumazet >>> >>> In case user program provides silly parameters, we want >>> a map_alloc() handler to return an error,

Re: [PATCH bpf-next] bpf: fix sock_map_alloc() error path

2018-02-13 Thread Daniel Borkmann
Hi Eric, On 02/14/2018 12:43 AM, Eric Dumazet wrote: > On Tue, 2018-02-13 at 15:33 -0800, Eric Dumazet wrote: >> From: Eric Dumazet >> >> In case user program provides silly parameters, we want >> a map_alloc() handler to return an error, not a NULL pointer, >> otherwise we crash later in find_an

Re: [PATCH bpf-next] bpf: fix sock_map_alloc() error path

2018-02-13 Thread Eric Dumazet
On Tue, 2018-02-13 at 15:33 -0800, Eric Dumazet wrote: > From: Eric Dumazet > > In case user program provides silly parameters, we want > a map_alloc() handler to return an error, not a NULL pointer, > otherwise we crash later in find_and_alloc_map() > > Fixes: 174a79ff9515 ("bpf: sockmap with s

[PATCH bpf-next] bpf: fix sock_map_alloc() error path

2018-02-13 Thread Eric Dumazet
From: Eric Dumazet In case user program provides silly parameters, we want a map_alloc() handler to return an error, not a NULL pointer, otherwise we crash later in find_and_alloc_map() Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Signed-off-by: Eric Dumazet Reported-by: syzbot