Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c8d7cda authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Subash Abhinov Kasiviswanathan
Browse files

net: diag: Don't double-free TCP_NEW_SYN_RECV sockets in tcp_abort



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.

CRs-Fixed: 2273814
Change-Id: Ibfa198049ba3e4a7b9161bf253600fb74de05bea
Cc: David Ahern <dsa@cumulusnetworks.com>
Tested: passes Android sock_diag_test.py, which exercises this codepath
Fixes: d7226c7a ("net: diag: Fix refcnt leak in error path destroying socket")
Signed-off-by: default avatarLorenzo Colitti <lorenzo@google.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
Tested-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Git-commit: acc2cf4e37174646a24cba42fa53c668b2338d4e
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git


Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent a60934ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment