Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/ipv4: disable SMC TCP option with SYN Cookies

Currently, the SMC experimental TCP option in a SYN packet is lost on
the server side when SYN Cookies are active. However, the corresponding
SYNACK sent back to the client contains the SMC option. This causes an
inconsistent view of the SMC capabilities on the client and server.

This patch disables the SMC option in the SYNACK when SYN Cookies are
active to avoid this issue.

Fixes: 60e2a7780793b ("tcp: TCP experimental option for SMC")
Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hans Wippel and committed by
David S. Miller
bc58a1ba b9ee96b4

+7
+2
net/ipv4/syncookies.c
··· 349 349 req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; 350 350 treq->snt_synack = 0; 351 351 treq->tfo_listener = false; 352 + if (IS_ENABLED(CONFIG_SMC)) 353 + ireq->smc_ok = 0; 352 354 353 355 ireq->ir_iif = inet_request_bound_dev_if(sk, skb); 354 356
+3
net/ipv4/tcp_input.c
··· 6256 6256 if (want_cookie && !tmp_opt.saw_tstamp) 6257 6257 tcp_clear_options(&tmp_opt); 6258 6258 6259 + if (IS_ENABLED(CONFIG_SMC) && want_cookie) 6260 + tmp_opt.smc_ok = 0; 6261 + 6259 6262 tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; 6260 6263 tcp_openreq_init(req, &tmp_opt, skb, sk); 6261 6264 inet_rsk(req)->no_srccheck = inet_sk(sk)->transparent;
+2
net/ipv6/syncookies.c
··· 217 217 treq->snt_isn = cookie; 218 218 treq->ts_off = 0; 219 219 treq->txhash = net_tx_rndhash(); 220 + if (IS_ENABLED(CONFIG_SMC)) 221 + ireq->smc_ok = 0; 220 222 221 223 /* 222 224 * We need to lookup the dst_entry to get the correct window size.