Re: [PATCH net-next] bpf: fix oops on allocation failure

2017-08-28 Thread David Miller
From: Dan Carpenter Date: Fri, 25 Aug 2017 23:27:14 +0300 > "err" is set to zero if bpf_map_area_alloc() fails so it means we return > ERR_PTR(0) which is NULL. The caller, find_and_alloc_map(), is not > expecting NULL returns and will oops. > > Fixes: 174a79ff9515 ("bpf: sockmap with sk redire

Re: [PATCH net-next] bpf: fix oops on allocation failure

2017-08-28 Thread John Fastabend
On 08/25/2017 01:47 PM, Daniel Borkmann wrote: > On 08/25/2017 10:27 PM, Dan Carpenter wrote: >> "err" is set to zero if bpf_map_area_alloc() fails so it means we return >> ERR_PTR(0) which is NULL. The caller, find_and_alloc_map(), is not >> expecting NULL returns and will oops. >> >> Fixes: 174a

Re: [PATCH net-next] bpf: fix oops on allocation failure

2017-08-25 Thread Alexei Starovoitov
On Fri, Aug 25, 2017 at 11:27:14PM +0300, Dan Carpenter wrote: > "err" is set to zero if bpf_map_area_alloc() fails so it means we return > ERR_PTR(0) which is NULL. The caller, find_and_alloc_map(), is not > expecting NULL returns and will oops. > > Fixes: 174a79ff9515 ("bpf: sockmap with sk red

Re: [PATCH net-next] bpf: fix oops on allocation failure

2017-08-25 Thread Daniel Borkmann
On 08/25/2017 10:27 PM, Dan Carpenter wrote: "err" is set to zero if bpf_map_area_alloc() fails so it means we return ERR_PTR(0) which is NULL. The caller, find_and_alloc_map(), is not expecting NULL returns and will oops. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Signed-off

[PATCH net-next] bpf: fix oops on allocation failure

2017-08-25 Thread Dan Carpenter
"err" is set to zero if bpf_map_area_alloc() fails so it means we return ERR_PTR(0) which is NULL. The caller, find_and_alloc_map(), is not expecting NULL returns and will oops. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Signed-off-by: Dan Carpenter diff --git a/kernel/bpf/so