From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B136AECAAD5 for ; Mon, 29 Aug 2022 11:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbiH2LO4 (ORCPT ); Mon, 29 Aug 2022 07:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbiH2LNe (ORCPT ); Mon, 29 Aug 2022 07:13:34 -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 C72E46EF11; Mon, 29 Aug 2022 04:09:22 -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 68F836119A; Mon, 29 Aug 2022 11:09:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C724C433D7; Mon, 29 Aug 2022 11:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771361; bh=d0jzzWeYwW6y3dWo8vEIEcbUQKTc2Bx34MAZ6E9eQhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pl6it1ZKIBA8Yaa/rifKi4YbM9E0Ppr01LtAsRI08FclA1HC4slb7diQ6fGa2W0XW eIywYmu/hIQOEm90Mtp7f5pmzXp+bT4BllDPqQrJMwZPcrK/JnzMdCfaAhY+v/dzha Q3vlvfWGrR1nZJ/1wfiMO0K5x2GbkdvSDhlT1QYk= 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.10 55/86] net: Fix a data-race around sysctl_net_busy_read. Date: Mon, 29 Aug 2022 12:59:21 +0200 Message-Id: <20220829105758.787792768@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105756.500128871@linuxfoundation.org> References: <20220829105756.500128871@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@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 f01e71c98d5be..1bb6a003323b3 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3032,7 +3032,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