Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3055107rwe; Mon, 29 Aug 2022 05:13:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6UZ1qC3NCPoSldmXo18cYKnYbebrJRaAaglm3j3eBFHkCfSho3MFGSY7PnLeoNah67Tw1k X-Received: by 2002:a17:90b:4ac3:b0:1fd:ded0:ea80 with SMTP id mh3-20020a17090b4ac300b001fdded0ea80mr3004164pjb.142.1661775214350; Mon, 29 Aug 2022 05:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775214; cv=none; d=google.com; s=arc-20160816; b=t6FQ/TvoEgAYhrdYFDyyFpVtHnrJjUZ99rj3UniyyYrXGrdk98ZWKIdZEM/AVWR+5U l7FAcFNkDebi8nu+EWirh/O68kQJdbY+YmtL03s4wPrEPNuYwUz/AP0JQiK7rgq+HtYX mOj0XNtZg+7utXEDZlbatNFXGk8opqbKGt1T/Tf0qeWScx99GM8SdC8geaGO5whD8geU 64z6e/mCohLb8vt9ASGDSh7Pz69Y9NHCrhug8BcUCtELtX6WZza/Fjr7LN75KI9jjKFW zoozJairJuHmO90Okpav05qTzN+3qBWfH4HIXzsf1QanuEFCrxsKJ0VgpQPzWhPp5G3P emPg== 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=A97ON0o6iIyVUpLe1xuiIiw8BL6K+k/wOj8DWaFa1to=; b=EVDln5w+sSwlCB8kg9Tr0yfzrizMtnPFZ/kztZrP8Gn5y81yWj++HnrT+asJ2G5reS C1ysbsS7B2j9ppZjHAMfFib6hJm0ZeUevrhfklctodjDrDHSVGmdvAoZRgK8f1DwugQS lGyGCz/Bn0lZppxHI/EFCHNtj33nOD7W/DzSaOT9Siky23b2WCF1mNWaZ7bSJY5ih+6L 9jLHgbne19xPqD1fESLLXgEtDtICmYIFOCYvW5h2pQrWY1tt5fn4v/i1ySe1c8wvhUmA 9EbEA+P+v8w4MTZw6Y4UQE+uKv/0ZZjFJtElS2MMrzAlqvpfmYaJx0gQjcu34rXe0iiK HvnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ekrhZt4S; 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 z1-20020a170902ccc100b00174a1ae02a2si4217925ple.582.2022.08.29.05.13.09; Mon, 29 Aug 2022 05:13:34 -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=ekrhZt4S; 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 S231160AbiH2LQ4 (ORCPT + 99 others); Mon, 29 Aug 2022 07:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbiH2LOu (ORCPT ); Mon, 29 Aug 2022 07:14:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C8F72EE6; Mon, 29 Aug 2022 04:10:59 -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 C30F5611F4; Mon, 29 Aug 2022 11:10:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEB49C433C1; Mon, 29 Aug 2022 11:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771459; bh=W44FEAb37n7Wy9RGxWFSblgq5CDx+4dVjGZlb+fJRmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ekrhZt4SYiM/rO6nnmLrOGilA37DU3blHqvIqSKay9CTiExoRribJPclHxFdjTqRi 1uv2NoJT1XxDuTnF/lZJnD2OrnS7WZagwo4uH/0q8helKG0ctHPA6E4BCpLHpMEzl8 JKiFzOcnqeQ3LomrpX8LNKNmIrWoTHuU4rmAlm3k= 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 57/86] net: Fix a data-race around netdev_budget_usecs. Date: Mon, 29 Aug 2022 12:59:23 +0200 Message-Id: <20220829105758.885353984@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 fa45d484c52c73f79db2c23b0cdfc6c6455093ad ] While reading netdev_budget_usecs, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 7acf8a1e8a28 ("Replace 2 jiffies with sysctl netdev_budget_usecs to enable softirq tuning") 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 c4eb1b666a21c..8355cc5e11a98 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6879,7 +6879,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); + usecs_to_jiffies(READ_ONCE(netdev_budget_usecs)); int budget = READ_ONCE(netdev_budget); LIST_HEAD(list); LIST_HEAD(repoll); -- 2.35.1