Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3051885rwe; Mon, 29 Aug 2022 05:10:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR5YUrWkgNv3z8Rny16EUCQh2wVkhDdIVjfuZWm6QunHBX6bN4tuk2dI6CJXSUOp8Nxm9pDh X-Received: by 2002:a05:6402:1f87:b0:43b:b88d:1d93 with SMTP id c7-20020a0564021f8700b0043bb88d1d93mr16153934edc.314.1661775046246; Mon, 29 Aug 2022 05:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775046; cv=none; d=google.com; s=arc-20160816; b=M/AmCKWfVFEKaDmSXnGoEOnPCQ42IxxKG7TnmINi9iYcuvlV6QfKjcSSYPkPDsN/k9 NbmKrfh+XwWAWUbbVC41DyzeCy/71t8r8Ocuqs4swB7hf6SDnKWkYn4olZ2dEzgvj7AF OvBZ7GO+9mUcl9hoORvmE3sjxclVhyC9JScNHS5ZkTniJ4RfQ6yOj2fYdCAIEXRPW6jJ A4Mz91OkBvjeTwVA0SXghhXKWjArA3i150PgGe0taSgCO0ghYBLmPsFUVPo2ANSLP5qV lNulD1LQANP10NwdtBAGtr8Y+L8ZWSQD1HtV/S4v/HOpQvBq23tiig2opKkSaNXO6SNd k0xw== 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=8+F5o95u1/zpFJPbb8ebMxprBdWxFqKAhLJxZKnZwr0=; b=H4gmci1iQS/z7wd2jxUw5Jg3dJ3a7Xob/dg6LkaVgtzAuM13pl0iJIWZ0LPTPT+XfW Oq9bN13XfoVlcAAvrHsaNzBVM6UM5Eoj/dG529X8k5FHG8PrnsNUi5IR3Hp7ovGcL6zO mO15KzcYlXNSiQYLHOBhS4ApC/HK/TOO6SHn3ABFZxUIRCdV4v6to3a/zPAnr+oGYSqF oKs5P08Oh3efJvUjBVcWhHxsN3qpQDGM2bf3eO7nNOyxoa84lE5d2CO7TDvUuOFhRkRm Q1X/7FM7TnfYxkSUaMwKj0U6cUoOioVg8whkwUtbwhFpbzL0wQT55u2jCc6O7jZtOvdW 8Qlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AzuMTO5e; 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 d7-20020a50cd47000000b00446f88d415bsi6156109edj.448.2022.08.29.05.10.20; Mon, 29 Aug 2022 05:10:46 -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=AzuMTO5e; 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 S232235AbiH2L1n (ORCPT + 99 others); Mon, 29 Aug 2022 07:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231934AbiH2LZZ (ORCPT ); Mon, 29 Aug 2022 07:25:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B14A7674B; Mon, 29 Aug 2022 04:15:47 -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 ams.source.kernel.org (Postfix) with ESMTPS id 42AABB80EF8; Mon, 29 Aug 2022 11:15:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD2FFC433C1; Mon, 29 Aug 2022 11:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771719; bh=zAw9Qz5eVTs6jKYDhTZVLZUcpJ8E6p9Z7KRjpQWeG4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AzuMTO5eBCoc8iXR/Oj7fSrQsutQYUiUeU8RrMJfHmCU5w9aiVwy0i6N04qcGINvk eGsrDsfhdfUPE5xanw2cDGYZuEsj0wlefwd5Q9plOqR/kzMD5XP5CmJitnZgt9ZCsN EcQ5LJoTJWUfNOkhqrTOAriIIJLumP73CnVUa9Sg= 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.19 073/158] net: Fix a data-race around sysctl_net_busy_read. Date: Mon, 29 Aug 2022 12:58:43 +0200 Message-Id: <20220829105812.078974628@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105808.828227973@linuxfoundation.org> References: <20220829105808.828227973@linuxfoundation.org> User-Agent: quilt/0.67 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: Kuniyuki Iwashima [ Upstream commit e59ef36f0795696ab229569c153936bfd068d21c ] While reading sysctl_net_busy_read, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 2d48d67fa8cd ("net: poll/select low latency socket support") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/sock.c b/net/core/sock.c index d672e63a5c2d4..16ab5ef749c60 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3365,7 +3365,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) #ifdef CONFIG_NET_RX_BUSY_POLL sk->sk_napi_id = 0; - sk->sk_ll_usec = sysctl_net_busy_read; + sk->sk_ll_usec = READ_ONCE(sysctl_net_busy_read); #endif sk->sk_max_pacing_rate = ~0UL; -- 2.35.1