On 07/07/2018 12:31 AM, Lorenzo Colitti wrote: > When tcp_diag_destroy closes a TCP_NEW_SYN_RECV socket, it first > frees it by calling inet_csk_reqsk_queue_drop_and_and_put in > tcp_abort, and then frees it again by calling sock_gen_put. > > Since tcp_abort only has one caller, and all the other codepaths > in tcp_abort don't free the socket, just remove the free in that > function. > > Cc: David Ahern <d...@cumulusnetworks.com> > Tested: passes Android sock_diag_test.py, which exercises this codepath > Fixes: d7226c7a4dd1 ("net: diag: Fix refcnt leak in error path destroying > socket") > Signed-off-by: Lorenzo Colitti <lore...@google.com> > --- Signed-off-by: Eric Dumazet <eduma...@google.com> Thanks !
- Re: [PATCH net] net: diag: Don't double-free TCP_... Lorenzo Colitti
- Re: [PATCH net] net: diag: Don't double-free ... David Ahern
- Re: [PATCH net] net: diag: Don't double-free TCP_NEW_... David Ahern
- Re: [PATCH net] net: diag: Don't double-free TCP_... Eric Dumazet
- Re: [PATCH net] net: diag: Don't double-free ... Eric Dumazet
- Re: [PATCH net] net: diag: Don't double-f... David Ahern
- Re: [PATCH net] net: diag: Don't dou... Eric Dumazet
- Re: [PATCH net] net: diag: Don't... Eric Dumazet
- Re: [PATCH net] net: diag: Don't dou... Lorenzo Colitti
- Re: [PATCH net] net: diag: Don't... David Ahern
- Re: [PATCH net] net: diag: Don't double-free TCP_NEW_SYN_R... Eric Dumazet
- Re: [PATCH net] net: diag: Don't double-free TCP_NEW_SYN_R... David Ahern
- Re: [PATCH net] net: diag: Don't double-free TCP_NEW_SYN_R... David Miller