]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: fix races in tcp_abort()
authorEric Dumazet <edumazet@google.com>
Tue, 28 May 2024 12:52:52 +0000 (12:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:31:52 +0000 (14:31 +0200)
commit5defdaddd53a6ce47cdc3cbe9591bcc77ead6ddf
tree062207874b9d78420cfed2a5f7444a55c31b029f
parent105c66116a8bcebaab386ba2af083b4aa0083643
tcp: fix races in tcp_abort()

commit 5ce4645c23cf5f048eb8e9ce49e514bababdee85 upstream.

tcp_abort() has the same issue than the one fixed in the prior patch
in tcp_write_err().

In order to get consistent results from tcp_poll(), we must call
sk_error_report() after tcp_done().

We can use tcp_done_with_error() to centralize this logic.

Fixes: c1e64e298b8c ("net: diag: Support destroying TCP sockets.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Link: https://lore.kernel.org/r/20240528125253.1966136-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[youngmin: Resolved minor conflict in net/ipv4/tcp.c]
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp.c