Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3058195rwe; Mon, 29 Aug 2022 05:16:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7AoglpnT6HFEX6DKLfRc4LnOSyGF9Z8lEl9HJy8pm4c0Lb29NKvZfmy1zoHG3/pQvM6HsE X-Received: by 2002:a17:907:9620:b0:730:d5f4:d448 with SMTP id gb32-20020a170907962000b00730d5f4d448mr13371613ejc.45.1661775377557; Mon, 29 Aug 2022 05:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775377; cv=none; d=google.com; s=arc-20160816; b=TIgCRB3+z2EzSNEQZDw416E5515WkkEwG85sCTa1cKrPhkQncF0dFBptGfkofcGVst ly1Ucj6nMbE6u+scsvLm/wfvXCCgwpTW1ANNvmMNIWqpaI/p+LOi7aOA6Pijt5jqo93U 2r8EqeT8gQmj7CgOjFAAAUZ76OU+ak5YjbBQtZF/RzN69wC7jlKfiEYKZyOeRCi1AhlR Xi9mKI6eY4ssoC7/Txlcme2ej0xKL+EqFf8ftuJHFrsYgC7qcSixHGudwdzfzNrp7Qmn XSULrSHRTOjIG6Ihr+gAWnT182Qf8Ntv8Sej2m8bdd3M6m0bjLJFBmS4ySTFTystNEFQ 222Q== 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=NJx6cAXJLbQqYzuR3JKOKcEVy65kc2NQTMpukMAdIJY=; b=bd+Ui3DTL/n73E566PS0M3+NIz1BP1NSBiCPNAa4NwSsAla2TtM+T+WewlxvFI88Lr dSIjhyb4YOzWENsquUvxwb6cTKaCaO1dipWaNkPeUqgmwFoLiLLic1VHew7u3/shbelU vu5ZYsx3P9+Lmvje2MS2iC/J3pdsyFKO8FKVGKRhcSIVWPDcPt/z19Zi93/AoQ9WnWEV 9M/qcFOuSNcTnz1jlA5ZALCnqCq4Wu9XCteEbudcBQACrVR+0pfDvEhMBzYnVQedE1tq fwFSC/W8OHE5dGgafSxXBH3xIbcGoA7iVrHYFYm3PkjTZkCzDb6Y9J3JqEMj2+tOgzom xCzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FfvkTe8G; 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 f14-20020a056402150e00b00446eaa6faddsi5819393edw.445.2022.08.29.05.15.51; Mon, 29 Aug 2022 05:16:17 -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=FfvkTe8G; 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 S232918AbiH2LvD (ORCPT + 99 others); Mon, 29 Aug 2022 07:51:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232909AbiH2Luj (ORCPT ); Mon, 29 Aug 2022 07:50:39 -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 C6B5C6DAFF; Mon, 29 Aug 2022 04:33:42 -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 C5CB861203; Mon, 29 Aug 2022 11:09:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C94BC433C1; Mon, 29 Aug 2022 11:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771395; bh=gME/78e9hQfrVHYhlRezufF0jhw1X1/K8CozhJYSbQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FfvkTe8GiDebE/5VwWHvbAZehIIRipxsjmBeIzyuM9vxns4DBjVH18ZZbPxrM7sQA j1dvbgmGLS/Hno7n/JUeRimN92QsdrWNQpDe70WekhmqksbCki48da6x+wx4FAWsHr xp6VLSo0Wvzxm/l23Z8dzPbpCkn9r7jxmrr2jgDk= 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 56/86] net: Fix a data-race around netdev_budget. Date: Mon, 29 Aug 2022 12:59:22 +0200 Message-Id: <20220829105758.836431771@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 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 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 1ea75768c5b23..c4eb1b666a21c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6880,7 +6880,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