public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bpf: sockmap, double free in __sock_map_ctx_update_elem()
@ 2018-05-18  7:58 Dan Carpenter
  2018-05-18  8:27 ` Daniel Borkmann
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2018-05-18  7:58 UTC (permalink / raw)
  To: Alexei Starovoitov, John Fastabend
  Cc: Daniel Borkmann, netdev, kernel-janitors

We accidentally free "e" twice.

Fixes: 81110384441a ("bpf: sockmap, add hash map support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index c6de1393df63..216d5c9b0eb3 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -1833,7 +1833,6 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map,
 	if (tx_msg)
 		bpf_prog_put(tx_msg);
 	write_unlock_bh(&sock->sk_callback_lock);
-	kfree(e);
 	return err;
 }
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] bpf: sockmap, double free in __sock_map_ctx_update_elem()
  2018-05-18  7:58 [PATCH 1/2] bpf: sockmap, double free in __sock_map_ctx_update_elem() Dan Carpenter
@ 2018-05-18  8:27 ` Daniel Borkmann
  2018-05-18 14:39   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Borkmann @ 2018-05-18  8:27 UTC (permalink / raw)
  To: Dan Carpenter, Alexei Starovoitov, John Fastabend; +Cc: netdev, kernel-janitors

Hi Dan,

On 05/18/2018 09:58 AM, Dan Carpenter wrote:
> We accidentally free "e" twice.
> 
> Fixes: 81110384441a ("bpf: sockmap, add hash map support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
> index c6de1393df63..216d5c9b0eb3 100644
> --- a/kernel/bpf/sockmap.c
> +++ b/kernel/bpf/sockmap.c
> @@ -1833,7 +1833,6 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map,
>  	if (tx_msg)
>  		bpf_prog_put(tx_msg);
>  	write_unlock_bh(&sock->sk_callback_lock);
> -	kfree(e);
>  	return err;
>  }

Thanks for the two fixes, appreciate it! There were two similar ones that
fix the same issues which were already applied yesterday to bpf-next:

https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=0e4364560361d57e8cd873a8990327f3471d7d8a
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=a78622932c27e8ec33e5ba180f3d2e87fb806b28

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] bpf: sockmap, double free in __sock_map_ctx_update_elem()
  2018-05-18  8:27 ` Daniel Borkmann
@ 2018-05-18 14:39   ` Dan Carpenter
  2018-05-19  0:17     ` Gustavo A. R. Silva
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2018-05-18 14:39 UTC (permalink / raw)
  To: Daniel Borkmann, Gustavo A. R. Silva
  Cc: Alexei Starovoitov, John Fastabend, netdev, kernel-janitors

On Fri, May 18, 2018 at 10:27:18AM +0200, Daniel Borkmann wrote:
> 
> Thanks for the two fixes, appreciate it! There were two similar ones that
> fix the same issues which were already applied yesterday to bpf-next:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=0e4364560361d57e8cd873a8990327f3471d7d8a
> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=a78622932c27e8ec33e5ba180f3d2e87fb806b28

Hey Gustavo,

We're sort of duplicating each other's work.  Could you CC
kernel-janitors@vger.kernel.org for static checker fixes so that I can
see what you're working on?

We'll probably still send the occasional duplicate which is fine...

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] bpf: sockmap, double free in __sock_map_ctx_update_elem()
  2018-05-18 14:39   ` Dan Carpenter
@ 2018-05-19  0:17     ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-05-19  0:17 UTC (permalink / raw)
  To: Dan Carpenter, Daniel Borkmann
  Cc: Alexei Starovoitov, John Fastabend, netdev, kernel-janitors


Hi Dan,

On 05/18/2018 09:39 AM, Dan Carpenter wrote:
> On Fri, May 18, 2018 at 10:27:18AM +0200, Daniel Borkmann wrote:
>>
>> Thanks for the two fixes, appreciate it! There were two similar ones that
>> fix the same issues which were already applied yesterday to bpf-next:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=0e4364560361d57e8cd873a8990327f3471d7d8a
>> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=a78622932c27e8ec33e5ba180f3d2e87fb806b28
> 
> Hey Gustavo,
> 
> We're sort of duplicating each other's work.  Could you CC
> kernel-janitors@vger.kernel.org for static checker fixes so that I can
> see what you're working on?
> 

Sure thing.

I've been doing this work for more than a year now and just recently we 
are having these issues. I'm a bit curious about it.

> We'll probably still send the occasional duplicate which is fine...
> 

Yep. Not a big deal for me.

Have a good one.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-19  0:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-18  7:58 [PATCH 1/2] bpf: sockmap, double free in __sock_map_ctx_update_elem() Dan Carpenter
2018-05-18  8:27 ` Daniel Borkmann
2018-05-18 14:39   ` Dan Carpenter
2018-05-19  0:17     ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox