Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp502479imn; Wed, 27 Jul 2022 12:01:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uBSC1CYjMj0EfEOipAm1YFSIYy/z7IkYC9EU5SyMTWdhwLTnwwBr5AsPpeV5lEVFKFoi63 X-Received: by 2002:a17:906:730a:b0:72f:6ce7:8acd with SMTP id di10-20020a170906730a00b0072f6ce78acdmr19032589ejc.233.1658948497255; Wed, 27 Jul 2022 12:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658948497; cv=none; d=google.com; s=arc-20160816; b=Tpmbo8zIUepaGiBJOeYAEem0eop6+d3G/ZcalWqiwiN1oaU1DVPYRUJCLTZGd/Zulg Pd22PK0bwX6uV5PQ7f7PJ5WtQJ4cA665HISNuJaPPkeQQFaSfnoUO31ipH59edk+c5Wg 9RZVDyoV/2Jm2ts0/ro1BohCBgEXSPlGV3WtN8v3lHNYVJLBQNaAZCBknoRImmUw1vma E5DNUk5E21oOdknxHRIv5eTgHdex3j34vE598EAmrBxM8ZCvqdTM8Sl740SZmlb87ded 8a9uQ8IyJXeVvggPWv8mk5WXh/s3IEZZPl3nZvvrw1kWV2izUyWDalh4BpP5sgIhdJYB tZOQ== 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=QzMCog2R/uLT4uBc4xTQ9dX1hUpjhN8Vf7wLZj9XZXs=; b=sMiPpTv80FWGfPr6Ir8Ni7Ut/jNqMT4cVWEjoyfDYkzoA2LhFadKe1fgKr5Z3kBi1Y 8x8n5yp9plUQkgmVhM/MiOyFEHdzddfkBRMFAisv6PuTl4ShJeQcROlVXpfFcLGAJr0T I21f22b+QiSwnJq00ZYVQyzUILijm6w2OzUvVvxaemu6ymEuxtqQVf7ncxhU4yrjrFcP jRh3RcNS1VfA27FAYc4qFuQC0K04wNjZrmJdPyHYlsqKlLPO8GnyhM4rZBxlE0uWgwkP aLr9jFUpxPUzDydW5uUlYucKt0rjmJ00ne3DBT8bjwonXgVNyZ72bli+ive2oqDsmJLQ O2PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uCLi4cMD; 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 gs16-20020a1709072d1000b007262adb2086si20441489ejc.256.2022.07.27.12.01.12; Wed, 27 Jul 2022 12:01:37 -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=uCLi4cMD; 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 S239377AbiG0QkK (ORCPT + 99 others); Wed, 27 Jul 2022 12:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239589AbiG0QjU (ORCPT ); Wed, 27 Jul 2022 12:39:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46F295005D; Wed, 27 Jul 2022 09:28:49 -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 03ED1619FF; Wed, 27 Jul 2022 16:28:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E311C433D7; Wed, 27 Jul 2022 16:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658939308; bh=c4SmNGB0sRDDaEoM2NEHpYGli5ogoDdY1dHqExV2Ru8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uCLi4cMD0G3t15CyYuMwqE0DfukGkpCiDO4rbOIuQmmN2X3ohA1ystlrq3iee+aYO OcCJjn89RuEjRd8G7gbDVFSvlacmuU6bdsYitSK5YQccyEDGOMZuu9XPwS70styOZv i+a+h6YPoLHba5bDaGo163hU8Qi6TWwC9+DznY44= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuniyuki Iwashima , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 24/87] tcp: Fix a data-race around sysctl_tcp_mtu_probe_floor. Date: Wed, 27 Jul 2022 18:10:17 +0200 Message-Id: <20220727161010.006453319@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727161008.993711844@linuxfoundation.org> References: <20220727161008.993711844@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.7 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 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: Kuniyuki Iwashima [ Upstream commit 8e92d4423615a5257d0d871fc067aa561f597deb ] While reading sysctl_tcp_mtu_probe_floor, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: c04b79b6cfd7 ("tcp: add new tcp_mtu_probe_floor sysctl") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/tcp_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 0460c5deee3f..c48aeaef3ec7 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -172,7 +172,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) } else { mss = tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_low) >> 1; mss = min(READ_ONCE(net->ipv4.sysctl_tcp_base_mss), mss); - mss = max(mss, net->ipv4.sysctl_tcp_mtu_probe_floor); + mss = max(mss, READ_ONCE(net->ipv4.sysctl_tcp_mtu_probe_floor)); mss = max(mss, READ_ONCE(net->ipv4.sysctl_tcp_min_snd_mss)); icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, mss); } -- 2.35.1