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

Skip to content
Commit a1ff677d authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Gerrit - the friendly Code Review server
Browse files

net: tcp: deal with listen sockets properly in tcp_abort.



When closing a listen socket, tcp_abort currently calls
tcp_done without clearing the request queue. If the socket has a
child socket that is established but not yet accepted, the child
socket is then left without a parent, causing a leak.

Fix this by setting the socket state to TCP_CLOSE and calling
inet_csk_listen_stop with the socket lock held, like tcp_close
does.

Tested using net_test. With this patch, calling SOCK_DESTROY on a
listen socket that has an established but not yet accepted child
socket results in the parent and the child being closed, such
that they no longer appear in sock_diag dumps.

[Backport of net-next 2010b93e9317cc12acd20c4aed385af7f9d1681e]

Change-Id: I7e8bc9d1041c5b1d0a27d8bcea627322f3c54404
Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarLorenzo Colitti <lorenzo@google.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Git-commit: 9c712fe0f4a1317e33fb5c5b4529cea630aa1027
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarAshwanth Goli <ashwanth@codeaurora.org>
parent e165dd5e
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