Revert "tcp: fix races in tcp_abort()"

This reverts commit cae9d2b162 which is
commit 5ce4645c23cf5f048eb8e9ce49e514bababdee85 upstream.

It breaks Android testing and can be brought back in the future
in an safe way if it is really needed.

Bug: 411037744
Change-Id: I02ba2e4b3c519bad7686ddec5fa8a8ff7036768b
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-04-16 09:43:52 +00:00
parent 0f8bbe98f1
commit 6151e5151b

View File

@@ -4739,9 +4739,13 @@ int tcp_abort(struct sock *sk, int err)
bh_lock_sock(sk); bh_lock_sock(sk);
if (!sock_flag(sk, SOCK_DEAD)) { if (!sock_flag(sk, SOCK_DEAD)) {
WRITE_ONCE(sk->sk_err, err);
/* This barrier is coupled with smp_rmb() in tcp_poll() */
smp_wmb();
sk_error_report(sk);
if (tcp_need_reset(sk->sk_state)) if (tcp_need_reset(sk->sk_state))
tcp_send_active_reset(sk, GFP_ATOMIC); tcp_send_active_reset(sk, GFP_ATOMIC);
tcp_done_with_error(sk, err); tcp_done(sk);
} }
bh_unlock_sock(sk); bh_unlock_sock(sk);