Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1865657lql; Wed, 13 Mar 2024 10:10:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYYyoWFse8mwSjBiErPs9F8Q9YI8Sa+ovu6jqfzOAr8NWxW6P3mRBDzKwfDRNT4TDKSz/UovCX04HbeKqcLns1L8bfVrQir1bE+yN5Fw== X-Google-Smtp-Source: AGHT+IHM3alUDpXVamStU8XJ71QblZkHp/4fzU+Xuhr4xTLzrs36CCbpX8MJyR7wQgz2ZBHU3F92 X-Received: by 2002:a05:6214:2263:b0:690:b66b:c43c with SMTP id gs3-20020a056214226300b00690b66bc43cmr638061qvb.24.1710349830859; Wed, 13 Mar 2024 10:10:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710349830; cv=pass; d=google.com; s=arc-20160816; b=JNBjmuyMWyM+Rs4vSaRjWq0K8Uku8CakAgxQg1T5W5FoTpaIlWrYjhZ8lNzpLx6fqc 5runHVUwzVu5+qBLkCDmAnV19EOXp/QBo/UISTIS1s/gf6SMrKnyNLlsPS2Pyj1HTX++ 6RNOKOiV8vSiKKDQPAVagqXm4L4Dp7PCJBwsk119mg/aEN/vPYwCuq5LFcfSkP4eYk/3 NmLoSVwn1zEFxiktyT94viba5kV0hWV5pa19zpJ+J4/mLu3QIUk1+ELNp+yQysXNkuQ7 yMs2uBCb7TdZAhYkYSesEXD9Ynei0TEKbJggtb3iJ5AYlmJtbMJSRApty2kDUQ2sE2Az ot+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=799HaMFS2PzSuJ8G9Mu4cbosQR3cYaanc/bGewv7+VQ=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=hEYTGBBhAyApOyleMPHw9hdaTRlkTNtioLScRnRZT7gCbcZKLdPEJqAcKVreTLKLr1 mZjfgHYXjUA+xs4rVLKRciVHNDVT/WqTvqi5KGZGAs9PWCz9dA4rc2GtxDxZeCbT+crl AfeSMUOv0s20nYv25zrPK+uvH7yW2YYy0uH2RIEe/Rb80c4OhwMRhdiAbBlXpw2ttdQX gqwuXNVKKPlxil8Hzk5VJJw1XZYaMrPbYT8Oq/7yt1NE+yPtAU1uCHKrZgFTgzeKVrCq 3Ls+tPIyLLd6fKIbD5wcMPCF7fQjM+YmYNoHAnBFPyF7s5Ahw0/sDOWjBHbTkramA5YH AQhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ksFpzSfz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ke12-20020a056214300c00b006900688911asi10214872qvb.542.2024.03.13.10.10.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:10:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ksFpzSfz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8AD811C21767 for ; Wed, 13 Mar 2024 17:10:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1F0A7F47A; Wed, 13 Mar 2024 16:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ksFpzSfz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D806F7E798; Wed, 13 Mar 2024 16:40:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348031; cv=none; b=Qemkt6kzFPiP2q7WXfmtrn2Cs3fzD8O/Lz6Tt+JZjncdMIy4du3ZkBWaZ61WRsCIPTdCNYRyHMGLOJIpkE9W0MsUGQXIYxlsivaxCBrvzy29VSLDysfgLwsQ1MVhIyaoTbZFbzX06WuYXq+9HV+Y/wG24Qk8q1DNss6zYQBcpaE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348031; c=relaxed/simple; bh=3AWhKptyhC8XfLyB3pmytWkHsxrKPkwi3z7ElI2NOhs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h28OPzbVGdGL9GS0jkX0YjPYAZYzN+7si0xIGNFmVxXQ+zkCqRnWFWox7KjzCjFwAuMWyUh/NRpj7b3wrdJDhahauXptX9GrY6k1S3LgCP/eZIp1zg19s/3HygUrXMofQ1dkr3+jzBxlaT1VNEfe/vvmP+zu8WDL9AMZ/RSmJug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ksFpzSfz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D966C43394; Wed, 13 Mar 2024 16:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348031; bh=3AWhKptyhC8XfLyB3pmytWkHsxrKPkwi3z7ElI2NOhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ksFpzSfzBl2HwoplxWoVoDZxv+UowfplN6lXlVLf+Pdo7FICRiK5uc6HC2/IOq/2l 4UtHy9XRQ2cIEeR5eoNW/qxL5pdCjxixnC+WrofAn+dasujq5sM+pD3GLZPQTwhwQp gOzVdkVeXj9/56D0VAuSxqMoiF8nVfs/7rUX2Iiz8r9CzLzeqh5Wfm8D9A3RDy6X/o 3ClElRKxUFB5D0CoDX44gsmpBqzHTqVwLTvEM4NlV3299AoxBThikGL6i2mY2+eLZj KDkgk0OmBlOL+Stmu7cE8qbSiajBIcJK2gszA/i9dQVHBnAVOIV9aJ6M2sGYTRC209 jVjsSiVa7L1MA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 28/71] netrom: Fix a data-race around sysctl_netrom_routing_control Date: Wed, 13 Mar 2024 12:39:14 -0400 Message-ID: <20240313163957.615276-29-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163957.615276-1-sashal@kernel.org> References: <20240313163957.615276-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.82-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.1.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.1.82-rc1 X-KernelTest-Deadline: 2024-03-15T16:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jason Xing [ Upstream commit b5dffcb8f71bdd02a4e5799985b51b12f4eeaf76 ] We need to protect the reader reading the sysctl value because the value can be changed concurrently. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jason Xing Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/netrom/nr_route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index b8ddd8048f352..89e12e6eea2ef 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c @@ -780,7 +780,7 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25) return ret; } - if (!sysctl_netrom_routing_control && ax25 != NULL) + if (!READ_ONCE(sysctl_netrom_routing_control) && ax25 != NULL) return 0; /* Its Time-To-Live has expired */ -- 2.43.0