Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1871317lql; Wed, 13 Mar 2024 10:19:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMRlwAVHkAMAHH2owlBb2v6vXRrCVhjrus16DBvk44WvxUrbrDGAvrWpdzYtKkL7rE8cHqRnvJKTjcWEsGLN+GNKxOgYtbq39PnXgxOQ== X-Google-Smtp-Source: AGHT+IGP3xoq0jTE/aemwDPIsUbJXo1o9HDtvawbbEDGj47cA3cOpaMkoHf6N8Pxp0PwDAvaBZzC X-Received: by 2002:a05:6a20:4987:b0:1a1:4a97:c2bf with SMTP id fs7-20020a056a20498700b001a14a97c2bfmr3337571pzb.38.1710350374464; Wed, 13 Mar 2024 10:19:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350374; cv=pass; d=google.com; s=arc-20160816; b=uwwltrF6hnoBsM80EYfpILdLYTqPey6Xx+jh103ebIJO8M1aL6basacoZ9j09jo1N7 FRb66P5jMr+LbFx2givhISV/K21oTpEncoEK8i+qfYAPWSJPRaa3nNc2nOmvqV3zSElP GUz4tS9F1UbeEt360R/jwl2sjyYdgCjBIUiorbXzTEAhJGqet6fhKIMmvV8Ko6iOgQEg WvUtPJkNvRo7UGZg948G4nvPepC0mzOGXBXkqSoJCljiGvP0Y6xMFmBKbydrA4Jl2ldk bBY8sGV8H2IRwVcn3NSryr8UbSUYzXJpAGVeK0xQYWFq0ltqozp0TuonEZTpK3dn+M5I usJw== 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=1wHQV6frUpmJ9w4QnyrS6srRTtyDERlylDSg9oysi88=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=QVm7CgnImrbxhf3S9+RRqRYk8/2XrNwLCWCcPGfNQOTkUuH8pc2X9ohxgBgN1eSooj M9DTercj2SZzmUvAvqw0o4zfFHzqHhLbOpar2JYYjgPxNapwmv8clhuHz/AdzzZ3wsRO 4FBUZUO/z69kD9dlV6XtTYoD/Mo3VK5sGAdkssAXlTivC8vHLYIb/mc6jo+rCpotz+Jq DP1sz9Q/wiiExvVF0KMI2t7tIJhf3OU3XNjI++QxgQY9nm3swZbg8X9N2s99PHPlJ9TO 2gi+PITYfscg/0kr0QXW04hHoxhkdIkqMV0eoJEytn5VL+5aJt471T1V30hIzViYfEFR xbLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JqnnHD72; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101891-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101891-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 o21-20020a635d55000000b005dc82a6711fsi9152962pgm.102.2024.03.13.10.19.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101891-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=JqnnHD72; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101891-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101891-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 DE3CCB245D9 for ; Wed, 13 Mar 2024 17:09:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B2A17D06E; Wed, 13 Mar 2024 16:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JqnnHD72" 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 3156960EFE; Wed, 13 Mar 2024 16:40:26 +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=1710348027; cv=none; b=Skfg6+JWqNrMmgfaXlvJZaSFfuVg8nzg5TV0bHBqJ+T8R46b+u6tNVkQTI0PfyNF1pjnmSsEikSWe0qakamQlrjZQS9K2U496FN8f1BClRfpdOxo+ypZEXFoyUu/KiuvR1tFPrIOrLRuPKNPgKHh+PPJxnXIIPX5FIdsK6fbp1M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348027; c=relaxed/simple; bh=dVRYMERwB+cOVOpagrrhjdSloMG8ShLCzuGWGxyuAbs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OafA1QpnlG+pQRr04hASK3mo4ABktZM7NWHNgnsbN4iUhtPJElzXlQocMZYndqXfhQdXlj0vkVDgulChhMU9d9y1cOF0Y8dc69zsF633g02gFVXs+Uyqfb1gNEaXe6J+3Pqwmg3Hdx1WFd79Cdiyq4MpVyXn0s1b+Xv4UsB1pkg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JqnnHD72; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 050D7C433F1; Wed, 13 Mar 2024 16:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348026; bh=dVRYMERwB+cOVOpagrrhjdSloMG8ShLCzuGWGxyuAbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JqnnHD72agA9OLuNyHrA4MKDicMTxuEr8e5MTYbdE6BVa54uJugTYpTwLNQw5YTNs +Cju0WFgGL8vKT8xcQ6FfwXbAtbFGFXLTl6GVFn/fJCZkpuj5sipDOQrDRkNHCVOb0 KtjW4roORE1/eGJpg/G0PJhSdYWviWvG/dfF/DYE2Dy7VLiSi6gDA6xMCqI2LisIGj C4TfAi7TVvILOFfxDDc9wkr+p28h186lPsEb+y8EsTV3V3KAxDohpse1Lc64XEqoo3 KX4cJc+zXDbC2m2MxbGydZafHsOBrXo7rOddtj3ItYZ14o8vNqRLpSQhEeafhBQLdA Bs/zVQ3+i3/jw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 23/71] netrom: Fix a data-race around sysctl_netrom_transport_maximum_tries Date: Wed, 13 Mar 2024 12:39:09 -0400 Message-ID: <20240313163957.615276-24-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 e799299aafed417cc1f32adccb2a0e5268b3f6d5 ] 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/af_netrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 3c6567af2ba47..be404ace98786 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -457,7 +457,7 @@ static int nr_create(struct net *net, struct socket *sock, int protocol, nr->t2 = msecs_to_jiffies(sysctl_netrom_transport_acknowledge_delay); nr->n2 = - msecs_to_jiffies(sysctl_netrom_transport_maximum_tries); + msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_maximum_tries)); nr->t4 = msecs_to_jiffies(sysctl_netrom_transport_busy_delay); nr->idle = -- 2.43.0