Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-15 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (refs/heads/master): On Mon, 12 Oct 2020 18:09:53 +0100 you wrote: > If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is > called unconditionally on skb_verdict, even though it may be NULL. Fix > and tidy up error path. > >

Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-15 Thread Jakub Sitnicki
On Thu, Oct 15, 2020 at 06:43 AM CEST, John Fastabend wrote: [...] > Jakub, any opinions on if we should just throw an error if users try to > add a sock to a map with a parser but no verdict? At the moment we fall > through and add the socket, but it wont do any receive parsing/verdict. > At

Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-14 Thread John Fastabend
Jakub Sitnicki wrote: > On Mon, Oct 12, 2020 at 07:09 PM CEST, Alex Dewar wrote: > > If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is > > called unconditionally on skb_verdict, even though it may be NULL. Fix > > and tidy up error path. > > > > Addresses-Coverity-ID:

Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-14 Thread Alex Dewar
On 14/10/2020 10:32, Jakub Sitnicki wrote: On Mon, Oct 12, 2020 at 07:09 PM CEST, Alex Dewar wrote: If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is called unconditionally on skb_verdict, even though it may be NULL. Fix and tidy up error path. Addresses-Coverity-ID:

Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-14 Thread Jakub Sitnicki
On Mon, Oct 12, 2020 at 07:09 PM CEST, Alex Dewar wrote: > If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is > called unconditionally on skb_verdict, even though it may be NULL. Fix > and tidy up error path. > > Addresses-Coverity-ID: 1497799: Null pointer dereferences

Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-14 Thread Jakub Sitnicki
On Mon, Oct 12, 2020 at 07:09 PM CEST, Alex Dewar wrote: > If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is > called unconditionally on skb_verdict, even though it may be NULL. Fix > and tidy up error path. > > Addresses-Coverity-ID: 1497799: Null pointer dereferences

[PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-12 Thread Alex Dewar
If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is called unconditionally on skb_verdict, even though it may be NULL. Fix and tidy up error path. Addresses-Coverity-ID: 1497799: Null pointer dereferences (FORWARD_NULL) Fixes: 743df8b7749f ("bpf, sockmap: Check skb_verdict and