Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp961335pxb; Wed, 6 Apr 2022 05:24:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpnxyX/NfjI5H7Y7MGGmI+3DoU/e2tw+SSXwXq0HX/NRXyssDzSf1Z6nbzaKnepPgTgyFh X-Received: by 2002:a63:f005:0:b0:381:f11:730c with SMTP id k5-20020a63f005000000b003810f11730cmr6670741pgh.156.1649247847273; Wed, 06 Apr 2022 05:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649247847; cv=none; d=google.com; s=arc-20160816; b=Stv4hUzLaI1eSwFjdWk29lZ0JP64vhSaNFrDl0nBJI0y7Jy3XKHdvQipDqOeHnXyeV RzBQO9vZliZv7arJKOkP/4sh3CjITTVgRHZQVQAR4q88D1WBvUU5p30SHvB3cYHmyTQt HTjTeAXX4nCaFrYoY3YV87IWnHN7Nn36kQ1kI9YiK0wjtY3FcCzcOLcOzTuEC+9CWoXD lUuZo8laUJn0krDR28r70Lhf7eafWwE+k9QPnhsYz+Q3L8uVEv6kBrw1+hZZMVNjciZS KaDMFU59A8uRn6ueGj6JOQoWsunDm4jpBvtn8HqI0FWh0jpLznIeD7y3YtMxuG/ii+PJ nDJA== 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=89wbwc1p2vkQAOq9bLSPhtvDdbKW1lOV8I7ILBsB1Ek=; b=GWXKq7d98zv5sZPd4aHZbhMa7CCD4OfEDMde4jr4082Rn8GiPNJoXhEWEFAIPXGE8c kLNPxnCT5aaASuglQEJHVXnJio+I0s6YKSvL/OuJZLxNnIKH8bRI2s/Oo2dYtm6JRlYF C5bOtl7YEiib9on7/HDjnHtJ1ayiQWm/sjG+D9smsa6a8L6y+NoFg0UDJqNt05aqm92J FARa+bAANRmz6y1y80HnuVRUsqUxasq3yeNIkRxEjOeKK07CgE2DMKZCRQghWCa4wGNo M+bLhX8Jz3m6FJ9MD/qSETl3U0TGdGLEXqtQ3g/+kMw2YeG0fril+v4tk62k2NDoX048 WstQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iII4sSTR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e90-20020a17090a6fe300b001c38029e0easi4539688pjk.53.2022.04.06.05.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iII4sSTR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E0CF48235E; Wed, 6 Apr 2022 04:29:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387351AbiDEVvG (ORCPT + 99 others); Tue, 5 Apr 2022 17:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349358AbiDEJtn (ORCPT ); Tue, 5 Apr 2022 05:49:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47A04A187; Tue, 5 Apr 2022 02:44:26 -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 D823261675; Tue, 5 Apr 2022 09:44:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1D3DC385A2; Tue, 5 Apr 2022 09:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151865; bh=C2yKtcHDtTIJB8VULrw6ebgViiHV2Kg1nkqwJGh5kjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iII4sSTRqP+YifhowUO2pdIpIJZvl40z2S8dDAwpbxhwxJ/X+atFYmtzogw4AHYla aTNZV+iCOGIkYCLsg8kf9OG2I9/v+A1cb0U4Wn4N4cj1wAhggLLJ9tYFk4Tvu0AT51 CEL2gWvVXbMYlROq6fsEh6XdnG1n49vDVngOoyDk= 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.15 568/913] tcp: ensure PMTU updates are processed during fastopen Date: Tue, 5 Apr 2022 09:27:10 +0200 Message-Id: <20220405070356.870224598@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 0492f6942778..369752f5f676 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3734,6 +3734,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; @@ -3748,8 +3749,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