Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp483558imn; Wed, 27 Jul 2022 11:28:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8ZbzhgmhTq1i2Wj/S61S3NBalYK+Flp3q6o+COu0fU/WacV8D+A9aAmgIJfymQ+3ZP5Hf X-Received: by 2002:a17:907:a40d:b0:72b:7f56:650 with SMTP id sg13-20020a170907a40d00b0072b7f560650mr18358628ejc.132.1658946496105; Wed, 27 Jul 2022 11:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946496; cv=none; d=google.com; s=arc-20160816; b=Jwiko5Zm6Rr9/WydzGbgYShVVenGNR7WEXPOwK6c6rxwKJcUcrWuWB1yqTmWZZCeau 8AspB3oaDEeSNE8pUDuhRIioLU/JTKNYVfqP2IcmWpom/pdjAQAPvmIrJ+OQqaHpe9S1 XcFrKu41pI4YJ2sBflJxkBJKUKfEZNfrNIx0sH8M2EbNGtyNSGx84G1qP6pIRd7aXLLT 2imNO40f6DDpDzwHX4z+YA/buVYDFu6W8d4PkuxjF7qpgtFIVjhlMOQHPSRj+T5mIIT9 ppHsxqTE40byNG9XaaEw7FXU+4X/VfYgiRIhQva9qNpG9eWUbq7jpFt9zdmQw446sli4 JDjw== 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=rRLlHMghje0rYg0gy0Hy2/XoLwjK+67rawR7LYG+Ya0=; b=ILekm1gvoK4luiOc6HQ73wp5VBwV6OoM0SHcD+fUFivhHePPzMIUVv6kAq7x8hVpD+ tpbJLYeQmpncsy3YsPcOhFUpPXXfryCwyAyM6UXcxGfHaqM0jgJLaYTPWj31kAZ3UvrN /eWyjP7wvJid6dhkNGgkUhgdO19qc+PW5l/QlPcYLHswMHmWYa0R3QhYmrQHTIR0ME+7 JsSNjiLQpZwamFjovpxX7Zez7kUk/wNV8D3M08iOXfiHH/SVoeoRoT7hGRvfeSVgb0hd VkPwRQHnDH53shUkXTEBF8jm8hc4GwFOpX40ei5GgdDQCzqpcq19orZkzjiLv9Zr4J0M P8tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wYcxgTIy; 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 n26-20020aa7c45a000000b0043cd07bb8c3si675969edr.380.2022.07.27.11.27.50; Wed, 27 Jul 2022 11:28:16 -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=wYcxgTIy; 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 S235040AbiG0QWD (ORCPT + 99 others); Wed, 27 Jul 2022 12:22:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234962AbiG0QVy (ORCPT ); Wed, 27 Jul 2022 12:21:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D0D4D147; Wed, 27 Jul 2022 09:21:50 -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 CD3E36199B; Wed, 27 Jul 2022 16:21:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBAC3C433D7; Wed, 27 Jul 2022 16:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658938909; bh=IgPZ4I7XBkIJS9kI5HUMyPbYRE5T9IPv1QQRGDc0AsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wYcxgTIykf87C8yU1s1pyW81N3MMNKVHXTD6vt3vpa/4bmjHVRWKgWz6ss61NgwQm 8/ACE+HQkbDIOhInaL2QgS/Ds7143/kjTNqUXB6ZJsQCb4CVAaPE5jd3SvydxlY1l/ of5oQJkVRRvXgRB/UvwHRiHJoTolqTHkwTLGcgr0= 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 4.9 11/26] tcp: Fix a data-race around sysctl_tcp_probe_threshold. Date: Wed, 27 Jul 2022 18:10:40 +0200 Message-Id: <20220727160959.587692269@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727160959.122591422@linuxfoundation.org> References: <20220727160959.122591422@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 92c0aa4175474483d6cf373314343d4e624e882a ] While reading sysctl_tcp_probe_threshold, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 6b58e0a5f32d ("ipv4: Use binary search to choose tcp PMTU probe_size") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e0009cd69da7..5b6d935a028c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2005,7 +2005,7 @@ static int tcp_mtu_probe(struct sock *sk) * probing process by not resetting search range to its orignal. */ if (probe_size > tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_high) || - interval < net->ipv4.sysctl_tcp_probe_threshold) { + interval < READ_ONCE(net->ipv4.sysctl_tcp_probe_threshold)) { /* Check whether enough time has elaplased for * another round of probing. */ -- 2.35.1