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 5AC0CECAAD2 for ; Mon, 29 Aug 2022 11:14:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231219AbiH2LOy (ORCPT ); Mon, 29 Aug 2022 07:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231282AbiH2LN3 (ORCPT ); Mon, 29 Aug 2022 07:13:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B14B6F55D; Mon, 29 Aug 2022 04:09:27 -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 D7356B80F52; Mon, 29 Aug 2022 11:06:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FF95C433D6; Mon, 29 Aug 2022 11:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771205; bh=Nb6+AMYQpGhnwYwdkReyMSW/tBCfGShXBCn1+KPqVqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CovXXTqvJDLj0crHfdN2u0QATIVIoM/bGfnZ00hA6BRLVwbc5OwbOUz4/pWe7zQv4 knfcjqnyFWzds0duN/VZtzdAsKsP+4U4prXNTbkpyxWqOxI0XhIS/PWdLbOmBTu6EV QsHR8Lb0usefCMkJ3UQnQlDuG5kIJo6q/R7unWJ8= 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.15 079/136] net: Fix a data-race around netdev_budget. Date: Mon, 29 Aug 2022 12:59:06 +0200 Message-Id: <20220829105807.882879650@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105804.609007228@linuxfoundation.org> References: <20220829105804.609007228@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 2e0c42374ee32e72948559d2ae2f7ba3dc6b977c ] While reading netdev_budget, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 51b0bdedb8e7 ("[NET]: Separate two usages of netdev_max_backlog.") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index 28f623628876c..fefe8ddd282fd 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7138,7 +7138,7 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) struct softnet_data *sd = this_cpu_ptr(&softnet_data); unsigned long time_limit = jiffies + usecs_to_jiffies(netdev_budget_usecs); - int budget = netdev_budget; + int budget = READ_ONCE(netdev_budget); LIST_HEAD(list); LIST_HEAD(repoll); -- 2.35.1