Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1872402lql; Wed, 13 Mar 2024 10:21:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUd1+W7li1nM+ENP63foyMRW5F6i8ektMdb3eaEL7xx1MRxwT2RlAzAsops/eKNG2q8oV4ihxzMc3JBlTPYB7VWuTRj3DVlGvTX0ZQLnw== X-Google-Smtp-Source: AGHT+IHi94/kMtpSzP5fyWq6MFcgDNNXJkQpnOg405AsLwf1b04678ZNP341pD9ICC35AVexS4cA X-Received: by 2002:a17:907:1681:b0:a46:1e16:316b with SMTP id cx1-20020a170907168100b00a461e16316bmr8675490ejd.66.1710350492763; Wed, 13 Mar 2024 10:21:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350492; cv=pass; d=google.com; s=arc-20160816; b=SLaRQy1Gp+EUmCswREEntoGuPbHmuzneKkKs617xO6tvYv5QVsIzMkYveJD4rFI4Tq I1AGAaY4493GxdfaOhGMKG7JZmJSeS0/OAf+fPq/w8iizykS9j6Kb3VTUYJcN3873TqG g0G+X9pE7DzasHEi3Cvfr4f6HssnO879iinJbiAnp183zvQ7amukbaDYJ5tJQpvuBoWK oYb7Y83ekJEQQm2TQqI+7838xLSyuu1i5bMrwRWSs3E6C8dCYMyLh+TuOsFqiub9RMb1 Hi+EJWdr55hxiIcNBtJ5YB9Txq7KZeTqd3HQoL0K1mjG93CRlR5EJeU450xETUk11eao zhTA== 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=s6xWcsTZfjO9bnQvqj1XlwbQt6IPOs0s7yzIo6GJ6Sxd0GKOH6Cr7LzQ/9vO4JjeAW xrdtIUot0WSYxRwnFGB0aUaMR3TNC4wsw2mcEhlP82q1SSKhEFGE0yXk6/zBRcKy40DW oQknLAXYuLDco/SVue8/15etp6xN8KkiCVZEd5sSNorOQRnUrnZE0p1yLr79iiRmLLFO iIHxu0NIqtk5+Nm/QOlFmTeym9qFdfewkWz1fd2Mp7/7ITPfutnYqbN/5jWCyManoccf Qp7LRteBpOunf1RN93xnhtYz5vXG1RZCoqPzFSZIULA3blDpSqGbFfRycrZ5ZTMRfRbg G3tg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WyjwqP1k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jr18-20020a170906a99200b00a4649541994si1453615ejb.654.2024.03.13.10.21.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WyjwqP1k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101897-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 30B4B1F2D5A9 for ; Wed, 13 Mar 2024 17:10:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38B3D7F7F9; Wed, 13 Mar 2024 16:40:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WyjwqP1k" 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 5E6E77F498; Wed, 13 Mar 2024 16:40:32 +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=1710348033; cv=none; b=I9FQFFc/2Z7amuze+SqmNlxg4sNVPE3mD8VHcGPzWzecS+IhwrzRt07vh0VyNej/JeCJuWWAuloqlJh+iduVOef7ftpx2xaolOnAM480ssmCTWmffAhZMRPXshcuuWVrqAjK3uGer1qvsZCazKQTJ/C/nWfmIPJRPUcial1jlG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348033; c=relaxed/simple; bh=D4rW9sjI93khwkpaWq93aiNXmRpAIL3WWyb7UQAT1cQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ra/vXS1in3adPoH5mchEZJ6davLju9JciN8mvYQfGS7BXE4dJMr2gm9GpW0RrH9A2rotoPcRivnbjtVE+PoapZuwrnVxk2ZuyJdrGLYY+dXAky+kasmg2LNRtDQDfx6u2SjBI0quDeOpE5sVqi5S/BeLWkdnovxZcNwaI9I0k3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WyjwqP1k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 198A6C433F1; Wed, 13 Mar 2024 16:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348032; bh=D4rW9sjI93khwkpaWq93aiNXmRpAIL3WWyb7UQAT1cQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WyjwqP1kPZzetZasYQ3UCxtcmhhu9mZ4iA+QtBy+zjYw1+O37PJv9WX1K+UKjYkq6 6DAnDy6HYSrVCeosYUqRjAKBPMEJkw25eE6kE5CC9mInfa2vLEY9v7fexa67vtEEn7 y1dOMfZnkAP0J3gl+Ffhr8i7uv8hmT5RaYalCavmzg96EG+eOMlxueRqhWNBv+BY93 oxRaSp7xTQgBc2TqH9KXGNPXkP/oTyp+1zow2Rs5FM34WfEtKqqqoe4Y9yEPge+49P FK0qDMxn4J4W2Hc7BQVUxBTXGCINZ2g9Nb9kyB78UHycxzYAQyqkwMJR4bltKnR/9Z /4gaW9De+wmlg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 29/71] netrom: Fix a data-race around sysctl_netrom_link_fails_count Date: Wed, 13 Mar 2024 12:39:15 -0400 Message-ID: <20240313163957.615276-30-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 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