Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp699855pxb; Tue, 5 Apr 2022 19:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4Oe40RQLg501IMKPQkhlnk+BI2pP5ueo21bDa0pTnkJjWQbo7VwmteLTbrhFFxNTLpEC2 X-Received: by 2002:a17:902:ec87:b0:156:9eed:b7de with SMTP id x7-20020a170902ec8700b001569eedb7demr6271541plg.5.1649211565126; Tue, 05 Apr 2022 19:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649211565; cv=none; d=google.com; s=arc-20160816; b=BdedMO1fxo/Bm8jFtW5/WezdLH7SyNIIih4KU0yWve0091Z0P5XnLSDZC6VG7FDU/S frpkaicPGQMjwWjBKMW+FJHNUZYb64n9z8sTMkRh9XZRGROfZuKFaEGuv5c4kawH2r4v qXF4LbD65LndQ75IyjIJ2/qWnbQUp4wicbMpOtCtPMoL4v6VIgxE4bPczHTm3bcCWm8F DM1UsvHp+a8x1poIuhFNOggrh7wf2m+cQN4s7hHaasVylEQ2J9dUA5q0Lj5ikmfbw/Lt 5thQ/CkKiA6P9FvnBQK478zeazLOZs3cfSFHdGfK3uS11Vq16fyGRAda3IkgY4ZqDo50 X5Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s5eik+iBT7zQO8XYRLSrZ4GHp1wUer7LOD53aNjyjso=; b=zwxey2vFujU/Fdf/x53Hg33TZDW39WmnB4LQs0V6Nwz95ddXe//yYECxzhwgIgB+5n s1k+sTH6bpGxwod9cjWJlj8pc8X8zRMIW1KySUYSnV4BoNW7zD7oCWa56/ecAjarxNw2 TESCHadI3gFgsh2LJ7nNGEhycF/as17S0wm6M+N/RoAhqOuVV9WKQ4Xfq8BnGggfRatT TP9G8/sn9cVOOGP2ckoV+Lal+gLX8xlSQEid6dD/BHRWDdUXGK/SHNlutVlKrrNBjGJ9 seC685hFfVyOSxrSGePbDuB964iwP13fiEMrojF3pDR6D61/CBR/RFPLmy9iDYVNwjdp G9GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EnLJjDWZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a170902ba9200b00153b2d165e8si14119091pls.496.2022.04.05.19.19.09; Tue, 05 Apr 2022 19:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EnLJjDWZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386604AbiDEMy5 (ORCPT + 99 others); Tue, 5 Apr 2022 08:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343904AbiDEJPJ (ORCPT ); Tue, 5 Apr 2022 05:15:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD2999157D; Tue, 5 Apr 2022 02:01:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 64DC761564; Tue, 5 Apr 2022 09:01:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DFC4C385A0; Tue, 5 Apr 2022 09:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149280; bh=6xtwrumsABCWlitwow9aJliVJSSME1aC9rJzVcirnrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EnLJjDWZOtWL99EKVUzMeg++L+CSPowC6CG/EGTqg5O+sKKbK3pnaen3o83/S8UZ6 j1Vz0A0wEqfAe6a/adtU2jDHVVNv338hh1sxmVsgKOE8qczjUjSuwYp0CYvi1AhmLY gm2hzVTlL204jF/nIg5YDA1g3cXrPfrtevZFWLa0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andre Nash , Neil Spring , Wei Wang , Yuchung Cheng , Martin KaFai Lau , Jakub Kicinski , Eric Dumazet , Sasha Levin Subject: [PATCH 5.16 0632/1017] tcp: ensure PMTU updates are processed during fastopen Date: Tue, 5 Apr 2022 09:25:45 +0200 Message-Id: <20220405070413.043618621@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakub Kicinski [ Upstream commit ed0c99dc0f499ff8b6e75b5ae6092ab42be1ad39 ] 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 Reported-by: Neil Spring Reviewed-by: Wei Wang Acked-by: Yuchung Cheng Acked-by: Martin KaFai Lau Signed-off-by: Jakub Kicinski Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220321165957.1769954-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv4/tcp_output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 2e6e5a70168e..3a8126dfcd4d 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3719,6 +3719,7 @@ static void tcp_connect_queue_skb(struct sock *sk, struct sk_buff *skb) */ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) { + struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); struct tcp_fastopen_request *fo = tp->fastopen_req; int space, err = 0; @@ -3733,8 +3734,10 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) * private TCP options. The cost is reduced data space in SYN :( */ tp->rx_opt.mss_clamp = tcp_mss_clamp(tp, tp->rx_opt.mss_clamp); + /* Sync mss_cache after updating the mss_clamp */ + tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); - space = __tcp_mtu_to_mss(sk, inet_csk(sk)->icsk_pmtu_cookie) - + space = __tcp_mtu_to_mss(sk, icsk->icsk_pmtu_cookie) - MAX_TCP_OPTION_SPACE; space = min_t(size_t, space, fo->size); -- 2.34.1