Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3071360rwe; Mon, 29 Aug 2022 05:28:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR7CqeeDsuLPiBxQUmHCb/5Lk5RO/I3ZVOz5onfGBodhScGcEwvZ4HGa1VaKHoAzi5f81zVK X-Received: by 2002:a17:90b:3508:b0:1fa:f7a8:811f with SMTP id ls8-20020a17090b350800b001faf7a8811fmr18245996pjb.7.1661776109677; Mon, 29 Aug 2022 05:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661776109; cv=none; d=google.com; s=arc-20160816; b=R2Rd1+lhm/Xfrvtxq55e+If2qH6afPhxDZeUrN89rPRO3hBhxYFhqQ897uNFCy+nuf he5X2v7JOtYPsdEccC11rhCSrsALQb/NvAcElSaRhaN7RKSb9mY32nu+IN4hLpordLWX pplKjERs2WNPD3vzyF9HgDM0Ps4QE21ExfOXr/1mtqkKHoqgZI6+3JgAuHXhtONc6IR+ EQ9ptJuNMN1o5WiTdOeM3G2U6yyTzbjpd6Ua0QaP0AuwTJbBBIIN+ihKoulY6Ouf+fwM 8L5QkQ8lqMnbSjgRLsLr1ZsY7WLxMOgX0fqobcBz/fIS+JEspm6E+71QXYpCEQ2CZ1kw GM8Q== 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=5XPVamXaJN6bnBpGENW413KwCijG5Mqw8ShBC9k6ZVY=; b=gzVrudAHLNC6zZ3JB+n5H3GUjq7XfcamjDxV4axko7BwFjYYMmXT7ZoO0ygSrQSkJb AtgZiWZ2Ah964kp+dBaD2woFZrvOsEq8A40WDMDwkAE7jCvtDl0nnn372Nbnigv8QDG+ fggXIOKNkkZL+PMMJWS367592thd/q0bBEjQwCcrAhu2FW5jPUDAteHolXvZKV0Aa9ZV mBH9fILkWUqGsLd0OHUE4xhfFmBgV+SvRZ0vqhVx1i16p9oYIb78Vcv17oapL/HLzdYx 08VZhxPf8oNMQk1GniWXoxxJ7hYHnSWtbfzs/NTwj3O2tvJVZms4kd3Pzyyh+/9anSsq oUIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tDM68i9N; 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 md14-20020a17090b23ce00b001fddf1a3380si1637727pjb.109.2022.08.29.05.28.17; Mon, 29 Aug 2022 05:28:29 -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=tDM68i9N; 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 S232941AbiH2LlU (ORCPT + 99 others); Mon, 29 Aug 2022 07:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbiH2Lk5 (ORCPT ); Mon, 29 Aug 2022 07:40:57 -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 B3BFC1A807; Mon, 29 Aug 2022 04:25:11 -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 1D741B80FBC; Mon, 29 Aug 2022 11:13:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81813C4314B; Mon, 29 Aug 2022 11:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771593; bh=l5TL+RjQ/+c8aJqbSDWtMBUEKOZ8GAHD9iwp2klwN2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tDM68i9NvAX5tyAswJ2fjGtpitLf8KUjTDiJubJURcMVLrPc/1EUFdEV3QsYWXjpS h8J5YvzkjitHffrKdnyJvHSoQVhhvwgnmidzohGA9XsHh8rDEJgZNsX4pAYYeqhz3Z cZPujc/JfD5sdOeWKgqZUFDETDLYOxAxbKceKHcE= 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 54/86] net: Fix a data-race around sysctl_net_busy_poll. Date: Mon, 29 Aug 2022 12:59:20 +0200 Message-Id: <20220829105758.756537406@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 c42b7cddea47503411bfb5f2f93a4154aaffa2d9 ] While reading sysctl_net_busy_poll, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 060212928670 ("net: add low latency socket poll") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/net/busy_poll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h index 716b7c5f6fdd9..36e5e75e71720 100644 --- a/include/net/busy_poll.h +++ b/include/net/busy_poll.h @@ -31,7 +31,7 @@ extern unsigned int sysctl_net_busy_poll __read_mostly; static inline bool net_busy_loop_on(void) { - return sysctl_net_busy_poll; + return READ_ONCE(sysctl_net_busy_poll); } static inline bool sk_can_busy_loop(const struct sock *sk) -- 2.35.1