Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3062834rwe; Mon, 29 Aug 2022 05:20:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR5stMVxZa/1vUvCEvaKpfvRu2GluOK3itIRLkitWfVtoMAW5LvL/6na1q6aNy16qq7YGId/ X-Received: by 2002:a17:907:7da0:b0:741:a1c5:bfa0 with SMTP id oz32-20020a1709077da000b00741a1c5bfa0mr1163647ejc.555.1661775618764; Mon, 29 Aug 2022 05:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775618; cv=none; d=google.com; s=arc-20160816; b=e2b7u1AW52PwsGrPySzssut9UTL8LWpQRsS1m9kRc8UuyfBbw9yJJEa7ndl+2XZZCG kFoA61Vd7vXqYNhRt2TB7NIqB2Zz+mYKtnRKq1SPK+JGSq+fgozTVwqBalnZfykrBMcN IFHRKwpr2bCGYg5oUZd24k05s8sS3B4acmnThB0iaayfGz/o0UHVw0wf2CpVZZ5df6k/ murOpIycFR4/cYoIE0laq5gNSJHcuT9n0Z2klJeifIZRtPJlPzKUqyhQ/nDjJID0N1sb uAXksobk199QRI91TseX0QHBdMKQ2apoRNm/5PpHX35ZpcD3OcE+xCA4NIKok02Npnk7 q/IQ== 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=V4vku75vyBLRBo17Dfl6D5bpMi8PaHjUiinczCXdeX0=; b=OdEojKuFVFde0mx+290JLQ8+/hsktxzdpaV3Gahkckjb4fEcsqIZhzArMSBAMUWyCB H4pJJ6Oor7t51TZXi4QjAhpG5FKca/YUpK3Y8f/iwuBtTC7uYjlGmtekqNodTy1psRrA 79BW/j38XfwyNlOiZX9CoerWIhYOFIfryoMFR81K6IFdl8JuV36GYpsmx62PpoBHquRg 6w0MsR1DiMBw5IXOysoJkFiFFeFF4wqQspZ9Ue41o5Asfq5/oA8B+qfLq9qS2ZMKQwSt kIW6UC42WI04YwkFzxEk6pGqne1VKS4GFvi2UXBoB4tr1J7urFpJI7ddeYox7xKN5MhH 48Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dFD9JjDU; 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 dm21-20020a170907949500b0072af6ec8081si7237780ejc.651.2022.08.29.05.19.53; Mon, 29 Aug 2022 05:20:18 -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=dFD9JjDU; 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 S230419AbiH2MRX (ORCPT + 99 others); Mon, 29 Aug 2022 08:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbiH2MRH (ORCPT ); Mon, 29 Aug 2022 08:17:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95FAF5C375; Mon, 29 Aug 2022 05:00:30 -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 25E5CB80EE6; Mon, 29 Aug 2022 11:16:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9179CC433D6; Mon, 29 Aug 2022 11:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771784; bh=OVfiCIC+cE2nB3VzGWdBCd9pK7dLD8IL+nIk9aRbV4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dFD9JjDUofDIEoRxzA8EHSQsmDAOdacIKCA1+2mzvxq7/pP+wTwGK+pm3e85KAfKA tZVk1oUTjklvoOOuGSPvIkq3b26OUcZMkun1ZIS4jjX1xZQ3FFHM2/9FEaEMsHmr8J r88ArUBFNmkOornH0B78YqnX07yu+xbF/6KqnNhM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuniyuki Iwashima , Edward Cree , "David S. Miller" , Sasha Levin Subject: [PATCH 5.19 079/158] net: Fix a data-race around gro_normal_batch. Date: Mon, 29 Aug 2022 12:58:49 +0200 Message-Id: <20220829105812.358908232@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 8db24af3f02ebdbf302196006ebb270c4c3a2706 ] While reading gro_normal_batch, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 323ebb61e32b ("net: use listified RX for handling GRO_NORMAL skbs") Signed-off-by: Kuniyuki Iwashima Acked-by: Edward Cree Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/net/gro.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/gro.h b/include/net/gro.h index 867656b0739c0..24003dea8fa4d 100644 --- a/include/net/gro.h +++ b/include/net/gro.h @@ -439,7 +439,7 @@ static inline void gro_normal_one(struct napi_struct *napi, struct sk_buff *skb, { list_add_tail(&skb->list, &napi->rx_list); napi->rx_count += segs; - if (napi->rx_count >= gro_normal_batch) + if (napi->rx_count >= READ_ONCE(gro_normal_batch)) gro_normal_list(napi); } -- 2.35.1