Luke Hsiao e3faa49bce tcp: enable data-less, empty-cookie SYN with TFO_SERVER_COOKIE_NOT_REQD
Since the original TFO server code was implemented in commit
168a8f58059a22feb9e9a2dcc1b8053dbbbc12ef ("tcp: TCP Fast Open Server -
main code path") the TFO server code has supported the sysctl bit flag
TFO_SERVER_COOKIE_NOT_REQD. Currently, when the TFO_SERVER_ENABLE and
TFO_SERVER_COOKIE_NOT_REQD sysctl bit flags are set, a server connection
will accept a SYN with N bytes of data (N > 0) that has no TFO cookie,
create a new fast open connection, process the incoming data in the SYN,
and make the connection ready for accepting. After accepting, the
connection is ready for read()/recvmsg() to read the N bytes of data in
the SYN, ready for write()/sendmsg() calls and data transmissions to
transmit data.

This commit changes an edge case in this feature by changing this
behavior to apply to (N >= 0) bytes of data in the SYN rather than only
(N > 0) bytes of data in the SYN. Now, a server will accept a data-less
SYN without a TFO cookie if TFO_SERVER_COOKIE_NOT_REQD is set.

Caveat! While this enables a new kind of TFO (data-less empty-cookie
SYN), some firewall rules setup may not work if they assume such packets
are not legit TFOs and will filter them.

Signed-off-by: Luke Hsiao <lukehsiao@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20210816205105.2533289-1-luke.w.hsiao@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-16 17:25:49 -07:00
..
2021-06-30 15:51:09 -07:00
2021-08-04 10:01:26 +01:00
2021-06-30 15:51:09 -07:00
2021-06-07 14:08:30 -07:00
2021-05-17 15:29:35 -07:00
2021-08-05 13:27:50 +01:00
2021-07-27 20:11:44 +01:00
2021-07-27 20:11:44 +01:00
2021-06-30 15:51:09 -07:00
2021-07-27 20:11:44 +01:00
2021-07-07 20:52:25 -07:00
2021-06-29 11:28:21 -07:00
2021-06-23 12:56:08 -07:00
2021-05-17 15:29:35 -07:00
2021-06-29 11:28:21 -07:00
2021-08-05 13:27:50 +01:00
2020-12-16 11:01:04 -08:00
2020-03-16 18:26:54 -07:00
2021-03-28 17:31:13 -07:00
2020-12-14 16:40:27 -08:00
2021-05-17 15:29:35 -07:00
2021-07-21 08:49:31 -07:00
2021-05-17 15:29:35 -07:00