Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1848962lql; Wed, 13 Mar 2024 09:45:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkwrrcsftZwDf0JVxaieQR5jx8OVnnmwIz8CKSZCZPvYZQLv0nBsyB51BTK90uh1aPRc5D8xhl7QgPWqrZ6AX88PfAL9Ze3M3AyTExDA== X-Google-Smtp-Source: AGHT+IFABsXShT47opEOdGEvdPiGBWe3kQ6MKX9uP62sWfKSXRg+yG0pqBPbpbyEN3BsZ+UdRQVu X-Received: by 2002:a05:620a:4494:b0:789:cad6:e202 with SMTP id x20-20020a05620a449400b00789cad6e202mr525215qkp.14.1710348308727; Wed, 13 Mar 2024 09:45:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348308; cv=pass; d=google.com; s=arc-20160816; b=HFsBNFkbYnL6dSgWTq4oftxMJHIH0Fr+Tn68X/ICiZV+YmeTrhO3xyDlEUwKDfz3kv +fEBeBxZQShiBZaeJ3JN18eehbd8LcSykTVM5Ri0NhS5iShdcQxpJc2tPgSWivG/kk2y RakiJdFkx9S/5NXWUMIX8RW5H4lFzSNemeAJoPEYK4ZifuJ78RbAUSxhsCsVefszwWob admDmOB5TYDZaZV3l0jo9MH9LoD2GadpSkFjXi5ZIhJnRcgUkvEb1N6Hdw3SWO4QFt++ 3EWzu8IzcK+YTvxzS8uEq55eMp8emtjXdgDmZw4J617yj1VegcMuBFrGCMX94kBfcSsJ Pw6w== 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=Bcqdf+E1aln3yqiBfpjydZsm9E5aByROmxF648tOCMc=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=V0P+lfZP+dHSIpsDbdbeyp/OvESNEUaBoCwJKuyRGR2jQ79h2xR73ZtyZG0gR1e3yx kLyvPTJXmWGrXhHaf/2Fdt80TFeuFt/ReT6SOqY2SjrKo3d64Mk+DuUEz+V/HCv6Y74+ gY4pKk8ejVhghnSeezyi+U9pruJb2vCL6XCR79WbPOrnOUgYjfcSasyT2xv6OdExGolz zAuh8Qs/DwnaRpEdX8QrTbW4PQo9xj7kgnQaZNl4J3G9geSYchE2cugf52F6UdJQpRYT mW3wF1/gYET9xAeGW+TKx2bFsGfT+P6p7ho+tDJYvH51tQK/GLYGtRyrfHJtLCqNnSz/ 0ymw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q0BOr6/2"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101792-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 x20-20020a05620a14b400b007888f4c90c8si3364078qkj.311.2024.03.13.09.45.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:45:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101792-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="q0BOr6/2"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101792-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 6771B1C21A21 for ; Wed, 13 Mar 2024 16:45:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D41365BD9; Wed, 13 Mar 2024 16:33:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q0BOr6/2" 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 BF4E965BC3; Wed, 13 Mar 2024 16:33:55 +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=1710347635; cv=none; b=DVKWIiRrHGyxdq1D9TEqvS1uqIgSLD4X0i3/DENjBN/UTUUm2jzS7lr5zlQQjfYdyveTB3JZPSXUxpVvpwActGW9UNP/gsibbrLJ2xOR86ENzM/iN56TfT5tWjvxuapXBexkVE2XljoZnQgsw3Yd5UvU52K3r011kBNk3vOR7OE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347635; c=relaxed/simple; bh=D4rW9sjI93khwkpaWq93aiNXmRpAIL3WWyb7UQAT1cQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PZmtznt6xJwaeaNe5+KTOQ9JGvXDatDowsdJh4hl6xvK/hrBM97/Qoj27ZQUr1d3CWR61YShbUB04BvilD7Kgt+cIV2dsw+HOES0kmSVS9x83oHBbwKOoDisSINJjPku3wW9gTfPYIWpG8Rv+nVTH43fTs989BjB6JPdHxG/KBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q0BOr6/2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 857C0C43399; Wed, 13 Mar 2024 16:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347635; bh=D4rW9sjI93khwkpaWq93aiNXmRpAIL3WWyb7UQAT1cQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0BOr6/2xQvFksnD4J15mfuhCOY6ned+P49P/muMl6hsP6aNnnOE0kSl2dmbrrnOy NKEwrjcz1b9bi+PGX2wc8K7wU6K4MCuUQK1RF9RwoIeZ5TzHi8TVr9pRGFHK0o4fAo ky9s0P9I1EwFLzYUml9rNpWgNEkrsUI7e1+zwilu38aEeTU1tLxzlIelqoGN80aeec cy5FQvAouVP8EmSVh2D5VpD1Lq6OMa1dQGATDatGZ79cWIkx2MbHqSyxh619sbVik2 466nmIfqH3PiYUkUHPSAHJjy1FOGtkfAN25F1PLROprn2UogHGBwnefPOTofp+C7Xr Yue8fSJEeayrA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.7 53/61] netrom: Fix a data-race around sysctl_netrom_link_fails_count Date: Wed, 13 Mar 2024 12:32:28 -0400 Message-ID: <20240313163236.613880-54-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-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.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jason Xing [ Upstream commit bc76645ebdd01be9b9994dac39685a3d0f6f7985 ] 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 89e12e6eea2ef..70480869ad1c5 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c @@ -728,7 +728,7 @@ void nr_link_failed(ax25_cb *ax25, int reason) nr_neigh->ax25 = NULL; ax25_cb_put(ax25); - if (++nr_neigh->failed < sysctl_netrom_link_fails_count) { + if (++nr_neigh->failed < READ_ONCE(sysctl_netrom_link_fails_count)) { nr_neigh_put(nr_neigh); return; } -- 2.43.0