diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2026-11-07 23:56:08 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-11-11 14:00:42 -0800 |
| commit | 93723db43e5185404e7d637357d07ffbb38e8b65 (patch) | |
| tree | e4ec802b06cff4b00df1e9458a7390bb72b1d567 /tools/perf/scripts/python | |
| parent | 08a1eb7a634f665718ebe74e0960e242f597135e (diff) | |
tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort().
When TFO is enabled, tcp_v[46]_connect() sets sk->sk_state to
TCP_SYN_SENT and puts the socket into ehash without calling
tcp_connect().
Then, tcp_fastopen_defer_connect() sets DEFER_CONNECT, and
the first write()/sendmsg() will call tcp_connect() and send
SYN with data if possible.
If tcp_abort() kills a socket before the first write()/sendmsg(),
the unhashed socket can still call it and send SYN in TCP_CLOSE.
Also, DEFER_CONNECT is cleared after __inet_stream_connect().
So, blocking write()/sendmsg() can release lock_sock() in
inet_wait_for_connect() while DEFER_CONNECT is set, and
tcp_poll() could set EPOLLOUT even after SYN is sent.
Let's clear DEFER_CONNECT in tcp_abort() and right before
tcp_connect() in tcp_sendmsg_fastopen().
Note that the last argument of __inet_stream_connect() is
changed from is_sendmsg to defer_connect as DEFER_CONNECT
is already cleared when __inet_stream_connect() is called.
This change is also needed for the next patch.
Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20261107235720.3129212-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
