tcp: ensure PMTU updates are processed during fastopen
authorJakub Kicinski <kuba@kernel.org>
Mon, 21 Mar 2022 16:59:57 +0000 (09:59 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 21 Mar 2022 21:27:15 +0000 (14:27 -0700)
commited0c99dc0f499ff8b6e75b5ae6092ab42be1ad39
tree2f356df678bed0821e92f4c6f94236d0f5d1ad2c
parent8d3ea3d402db94b61075617e71b67459a714a502
tcp: ensure PMTU updates are processed during fastopen

tp->rx_opt.mss_clamp is not populated, yet, during TFO send so we
rise it to the local MSS. tp->mss_cache is not updated, however:

tcp_v6_connect():
  tp->rx_opt.mss_clamp = IPV6_MIN_MTU - headers;
  tcp_connect():
     tcp_connect_init():
       tp->mss_cache = min(mtu, tp->rx_opt.mss_clamp)
     tcp_send_syn_data():
       tp->rx_opt.mss_clamp = tp->advmss

After recent fixes to ICMPv6 PTB handling we started dropping
PMTU updates higher than tp->mss_cache. Because of the stale
tp->mss_cache value PMTU updates during TFO are always dropped.

Thanks to Wei for helping zero in on the problem and the fix!

Fixes: c7bb4b89033b ("ipv6: tcp: drop silly ICMPv6 packet too big messages")
Reported-by: Andre Nash <alnash@fb.com>
Reported-by: Neil Spring <ntspring@fb.com>
Reviewed-by: Wei Wang <weiwan@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220321165957.1769954-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_output.c