Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1882385lql; Wed, 13 Mar 2024 10:41:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWyFBALEA4lylg+AwG/GKyk5Egov8R2joAIcW9SVGIaCWpWHs6iCW5wQn1snp6AnTgXFiaom6UYAuH+0VAmCR1ha8rxZ61JIRs54ezYTw== X-Google-Smtp-Source: AGHT+IF+ywFYE+brWzaiPTzuD/2ZMqeZTOsLNnNdh0vvddj/o3YULeMYab3leExznsTCaxwF1cCb X-Received: by 2002:a05:6a20:7d9a:b0:1a1:2d3a:2d19 with SMTP id v26-20020a056a207d9a00b001a12d3a2d19mr7949466pzj.51.1710351691155; Wed, 13 Mar 2024 10:41:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710351691; cv=pass; d=google.com; s=arc-20160816; b=Vxy4vs2feNnyTWogJYyTCZj7Jg44d1ZZjsMbibMnebkWsDFyvCbAU1s+f7l8xddZtz 5Y0L9SFo3vsiDTzSOkFYBM2KtKl3Tb+Zu95lu6NVsDAH32MscJOgnP6XMT9gk69itWdD sTzwQUwMGpD1I9vfi2Rwt8J02u6F/xYVSxN2Uo87693KYxh7PuKgaykOqrpXrDkk+i8z acq+ELT62ukjS1Jbr8hXKTHZuxvb23j6uw5PslU0nw1DpLsVuHdwBFWRhzJvfAo7BLdE fp5IxhZE9fkhD6m0KYek31f2/VMg3nZ5tCizlwF0JbFur0Eo9IWQTKhytQbD3KAbZpuo E8Ag== 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=sibnRCLQxexZEEtAp7QcUOqVRryGDWybsE7ANdmq3ms=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=gB4TLTLXTezSbe5VQZqPb/r++igZ74NnEadNHZvs1XqfU6LvWreXor1v9+6Qagacv+ I9rrGbOW6P7PHXxDm+sOcMb1OiTNVNBezv1manuEFnm+KgQ7lP152NIphahqkYL/1PDl PHTbMHfqUSjwqBNK504B6RKwoV8TKaQhQ+DVHR+oWTQzYiE2fz7FT3amsB2q7lWoButm RMvHgUKeQ+i4kf2w8rL0N5Cpc1gZVb8r9oKGQu7gBCze+xncyNb3qkd16q+NPU0BJfHx Rb5MHj4tIyQRXNS4kzmK+20bLXMD+Wi61lynQ9jYwowQrgIqSvtNxbVkJP8NoReOmxyu Md3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fbYXXriC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101965-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m68-20020a625847000000b006e69e291eadsi4822622pfb.379.2024.03.13.10.41.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101965-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fbYXXriC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101965-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101965-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4B071B2444A for ; Wed, 13 Mar 2024 17:27:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B73EA14291A; Wed, 13 Mar 2024 16:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fbYXXriC" 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 C3B281420CC; Wed, 13 Mar 2024 16:42:54 +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=1710348174; cv=none; b=AH7f3jKvsISf3NvjqZwESGAXPgRt1jWkCT1zMM2QJovlx/fxWWvPejWiP13tEZG0eCOYHE/0Fd59g+aPm1PdMjTTS4uYr4/XxtzSYWq6Uo05VlD//135TVWuHfZAqRKxiTJJlUGJZNUMUWqgk45UZ4y2zTiZkiMkBqaPSIkJDnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348174; c=relaxed/simple; bh=H4DfSV2MBlhDn7HAlV8mC+leAoVxNyHqkIWIC7yYs+s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qTxu71f8iepXCgp1bd70uTo+1g4FkHxFNjMPif9CNpupnWEoc8TmqYNntFgBFD4EBLiu7gSOWAd1A9GuXXNlEMCMv0pbX4h16aiOgtRgIYzQ4tj7urg0iWaTAMLt+rc4ZWg9bMAFQG6T3Yg6pU/vkca1P3iKW0sQxbuw3UiA8Yw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fbYXXriC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 643EBC43394; Wed, 13 Mar 2024 16:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348174; bh=H4DfSV2MBlhDn7HAlV8mC+leAoVxNyHqkIWIC7yYs+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fbYXXriCqeIPpqtmHHHXgZHNGLCk+s7MsIrIwM9i1ssAo6cqhmR8cKjTTeGrloTYT jXDzO4AortCT84P6jCHvjh4soqD76REpHvg5yTNbEF3+JTp21kXVhETlEanz4XJnih e+YsK52cBw/dFc9yB7SGCLrkis4QUP1kevg4Zf65FwroNnxWRW542DMnSmxFr/1+Nv ISQPMkUfzzoki+eoHztNj3siXnzwSICoe3R2Ju5sL72HKArbrhIkyjnbiew7ibklWe qpGhe9Z6Uj4GOKIrYq+9wRxGNCYNE1ogikkqWeVfg0D3IPBf67vPcLSuJ4VykRuCIY nsU5AMvKY7czQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 25/76] netrom: Fix a data-race around sysctl_netrom_routing_control Date: Wed, 13 Mar 2024 12:41:32 -0400 Message-ID: <20240313164223.615640-26-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164223.615640-1-sashal@kernel.org> References: <20240313164223.615640-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/v5.x/stable-review/patch-5.15.152-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.15.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.15.152-rc1 X-KernelTest-Deadline: 2024-03-15T16:42+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 e5d24462d5100..56bec5b5b37c7 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