Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3100411rwe; Mon, 29 Aug 2022 05:59:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5DB+PRxsDJBCZaBNXNIa1u5Om7bUr3qjcN+PjxvXlYt49BBGJ56UH92dEDesHMlfx08WQb X-Received: by 2002:a05:6402:268b:b0:446:381d:7b45 with SMTP id w11-20020a056402268b00b00446381d7b45mr16453586edd.372.1661777967631; Mon, 29 Aug 2022 05:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661777967; cv=none; d=google.com; s=arc-20160816; b=kU1FrVcbdo7OfplgAnxHshP30eCXtls0L6ASjXvmodQgRhyJs2+SNKHyLeusVopPvF GgOb7Y3kJAMGMLLHX4BJ9DfxpjkiwSR0vHJLGw3G6UMf4LNVXUcq3eCIIh5qd2jZgcsp 9CdGJWuGFJl5YsnRuS/rZ+LXjTWSGm+xr1o6rWNvn2Xf7dKhdgfxeuVQJ2kyIr84+51d phg04DbBU2ePS5qEYLuHZBg+1LHc+KMA53gl2PPC0GbJVio04PzwqW2vBbUFXC2cbR2x yx9Cus+I11LDgFvKmM7xw7VrXr8NsJdI3JwIuE/4c63O6nuuUaQNehZGDHBXyHbsa1yT bwJA== 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=q5ihqdXjeBPl4xXPkRW74+VxyTVaMXdleNjK7ST/0Oc=; b=D+AsiPgQOEXZOgwNXILDZOZp9zL6GxZj4JW4nbR2rl43cQGsRBYIfSkNNzAkdj+Ann vM2KWtFh9GBtEYubGIRK3XffuLQ8/8SJ2MUHzMJdiPkyTTWQAD9pdyEcaeevmZ82SgGn 7Zdt/ubRY2q2QRc3Qd4UYaHqwtIGhaVIUQqlf3xzkofV4uwlhITc/+sr8X7Pj7NdR4k/ QVt3s79Vmfl462flzYCkUdYPTw8XviiTNc2C4LR+B3uzX6VrJjzhAwViEW3o9RbZAEqX ItryUc7+fcECs+pPzDdnPoiFD0pCSz1VhN9F9inMBk6GsdHAGC5Um7beDyMlP/pDHzto 48sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="C/EB0nvd"; 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 y12-20020a056402270c00b0043df391fcbesi7217531edd.583.2022.08.29.05.59.01; Mon, 29 Aug 2022 05:59:27 -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="C/EB0nvd"; 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 S229536AbiH2Loh (ORCPT + 99 others); Mon, 29 Aug 2022 07:44:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiH2LnL (ORCPT ); Mon, 29 Aug 2022 07:43:11 -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 86427857DC; Mon, 29 Aug 2022 04:27:24 -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 388F8611C2; Mon, 29 Aug 2022 11:15:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29E3CC433B5; Mon, 29 Aug 2022 11:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771731; bh=RpKmRn+j85ozogCqWaFhx6L2PA8dH7V2AnILqV8enls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C/EB0nvd93eT86OPS/ZgQCAucLrv4xNsqbyKQsLX7huA2voRywQS52Yx8wZ5NHlZJ IS9X1OPPbK3U0bGuZw8Vek47UMEXEW1zMQLTrjIriJfWBVdaDhhVOHahU9rdVmgQ7W 0Ld6iEr/FPxA7tsv9hCf14rMazkewAyK0/HYgLCI= 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 076/158] net: Fix a data-race around netdev_budget_usecs. Date: Mon, 29 Aug 2022 12:58:46 +0200 Message-Id: <20220829105812.217130260@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 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 a330f93629314..19baeaf65a646 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6646,7 +6646,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