Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3071314rwe; Mon, 29 Aug 2022 05:28:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR6OBKezQubBvMWqJ9yaZ/M55ICXCDOb6//75aCsdfzYBxaAcCPcLqqLflkmrOXARsDBVEmG X-Received: by 2002:a17:903:92:b0:174:6796:e3d0 with SMTP id o18-20020a170903009200b001746796e3d0mr11124836pld.97.1661776106517; Mon, 29 Aug 2022 05:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661776106; cv=none; d=google.com; s=arc-20160816; b=eCmw5QboKqi1oPNq7/dUVwyNzLybsQfK5zo+PT6L1kwBDbKkLViHyg8rzo1ebgsLFy ya3P03CEkQLgavbDktVSTkDJyhVAP+SNEt2h3wWYiiq+PpfLT2HohHkjmsBE21yodBSv 3OrqTamluM1k5FK+ZZdPKjzdBBZD40GRG7XrZxj4ffN+pyQHAM+ThVEUnJC1rg7y0D+E ZS6VFRuq2O59n3wE2hXt1dBpjxr5PDiF92zmP7Qm4XvgTxZKlZZ6AFU3mKusf4CCBoW/ VkHVfHefo5Wlp8JrY6TFyUPGcwU37gLY+WDPb29cPB2UPkRHXAczOgoL6cq7C3OYTwMp NadA== 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=URWK+nTqGsEpKMOnaqjSttmTc3E2gYluGnr515US8uU=; b=0tiGceCkQQYIjmLjwxFpOuFS446HsiwcO3bqTcTf/jlgHk4jCBHHd/9TpTagjIaIrZ FWdAj43p+ZcW0IGJGCmGM4TE1bhxAmEWnv5f0c2wmBfsmS61SqW6+pO4TXnlTMnYScgW nhblt0adIMmZMbVQfBiAxdW37IqfzIJ/uD+jP/GoCvuOUUXwtm3ZWxWzKrF9Wj4GoXh9 haeQA4RnDOP/nSoVRN2VhFjZU9QRIqsq5wE+P8xJIL1Gh8IhgrYm4dZYOxXJWuoJ5xSn LYGzK1F5VC4wZ8xaN4AhkkGPpNwsnYNzigcJlkltKreABnkmOc6HeEuk+YG1Lw20FV9J azsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dTLt13AW; 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 bc22-20020a656d96000000b00429bf9c39c0si10328008pgb.255.2022.08.29.05.28.15; Mon, 29 Aug 2022 05:28:26 -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=dTLt13AW; 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 S232206AbiH2L1U (ORCPT + 99 others); Mon, 29 Aug 2022 07:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231853AbiH2LYw (ORCPT ); Mon, 29 Aug 2022 07:24:52 -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 8FC1F71BEE; Mon, 29 Aug 2022 04:15:50 -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 1DE70B80F03; Mon, 29 Aug 2022 11:15:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89E46C433D6; Mon, 29 Aug 2022 11:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771721; bh=KzwSRv61OBn3Nvt6TNRlZDd87GViEX11UlK3d83CzG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dTLt13AWZHt80c79AUhoAgjy2Hd1i2jn4PiDhRk3SPnhxzdTWui2oP2sUDV40QfkO OElnctQkiWxFslEJ/RLySJxwdCxUGfGdwmrkkn2K9WaC8eAypy6XdNhf+Ck4BtaMD6 1QzcWQRljedK9H5H/PTMbiO8RbM0yj7jNILVZUbU= 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 074/158] net: Fix a data-race around netdev_budget. Date: Mon, 29 Aug 2022 12:58:44 +0200 Message-Id: <20220829105812.127136518@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 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 34282b93c3f60..a330f93629314 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6647,7 +6647,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