diff options
| author | Chris Mason <mason@kernel.org> | 2026-11-07 23:56:09 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-11-11 14:00:42 -0800 |
| commit | 44809e49177992b15708a150437d9aebc5beea9c (patch) | |
| tree | 8496a3d28517c091057702eb7beac2b161579e0e /tools/perf/scripts/python/bin | |
| parent | 93723db43e5185404e7d637357d07ffbb38e8b65 (diff) | |
tcp: Drop any segments if DEFER_CONNECT is set.
TCP Fast Open lets a client send data in its SYN. With
TCP_FASTOPEN_CONNECT and a cached Fast Open cookie, which the server
sent in the SYN-ACK of an earlier connection, the connection is set up
in two steps:
- connect() sends nothing, so that the SYN can carry the data of the
first write(). It only sets DEFER_CONNECT and inserts the socket into
the hash table in SYN_SENT.
- The first write() calls tcp_connect(), which runs tcp_connect_init()
and sends the SYN.
A socket must not accept any segment before it has sent its SYN. But
nothing on the receive path checks DEFER_CONNECT. So until the write(),
the half-initialised socket processes segments like any socket in
SYN_SENT, and a forged SYN is accepted.
Similarly, ICMP with seq matching ISN is accepted in the state.
Before commit 57889a8f6d49 ("tcp: initialize send sequence numbers
before deferring TFO"), even seq 0 message was accepted.
Drop any segments if DEFER_CONNECT is set.
Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Chris Mason <mason@kernel.org>
[kuniyu: revised DEFER_CONNECT tests and the commit message]
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261107235720.3129212-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
