Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1874990lql; Wed, 13 Mar 2024 10:26:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWIErBAVvATXaAq2wnaSQW+v61DHA/hC8V0gN6rD1AFT+UBrs5MSKHY8t2Pnc+iG+0MJB4tehXNDqDwaXWOLLvvdNAqcyZQfbCapKvsQ== X-Google-Smtp-Source: AGHT+IGmtuAZq6bh35Gpx8nwwqHamE1TZ2DM9Voa2dF6jx+yyeKy7S8MYJZxp5+PrDouKl64/7xw X-Received: by 2002:a0c:f984:0:b0:690:c184:30cd with SMTP id t4-20020a0cf984000000b00690c18430cdmr507596qvn.32.1710350807751; Wed, 13 Mar 2024 10:26:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350807; cv=pass; d=google.com; s=arc-20160816; b=nEZbf2H32w7G4zHyNFhhELTyWQpCM3H0WxZetx12VWLNXtkNjco6vpj7Addj2bNhTA 5mJEubb8zw0qzh29+n6aO5ON1NoIZZs68fHDq8dlBPrl8tXC+lkBhszusJnu6tX5jK20 3FxjvphT1RWmMnSWwBVPj0BWgccMom01kvI9rEbfr1szJWpb3ZWs67nZPXIQiUkFB+WO m5drFwQycaEO01/M+G31RVUxixZOZ3Fcl2JvaWmvrmWlTAI9A74CrW7spWZIKLzLN403 gB6Av5KEUBBFgZUuoFCjm9ioNaFJu6+Qkq6Kvwx39f6Zh6HTuHn2Jx8JzpZ269BLw21f LEOg== 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=OeeufgYNAAyF14XBSsvSt/8jtvuCZ87phuzlkc4VG/s=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=xEO6vkZNbELzd1cBiKDjk0DomdUTPFCAO2IACRnfyPxNUrffM3UKaQx12cTax9oUxD beGjPvOLIXW2ceBf7RZaUZlqHCHZ9G/Z1Qa298OCjnfLgQEzBh/TKIJDq4WkNThY6zCv BR8mhvXGLPFtS9jOK2B6JcXx20si6NunWBD0NOXeb0rhbTueEHQq+giqmmGk8qYtvn/c j0Xm9qDGEogUqIqQZnVkPWiOQh5l++AfXZjSUzR+H3OL/KzxlKfGJI4swiG8eDcfGYo/ kFZrwYPTDiASI/4OIkm/Y7bQXqmOG0BEf15Be72p66SvCaim/+EF/UlOIbsjw9EuYkCL K2Bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uHRAPNgf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101962-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 12-20020a0562140ccc00b00690cfc85007si7442748qvx.490.2024.03.13.10.26.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101962-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=uHRAPNgf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101962-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 6D4DD1C20D4B for ; Wed, 13 Mar 2024 17:26:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54E2513F43C; Wed, 13 Mar 2024 16:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uHRAPNgf" 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 7128213EFE4; Wed, 13 Mar 2024 16:42:51 +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=1710348171; cv=none; b=oSPjOMjW/2RWASxbgR1COQg36uUx85sH9kBgPJM/xnUjj+x5wHu3PxC7934GIajM5GrmGqPMWpA6xWF0q2x3n0W1qSpVFOup+tJbZhy6kkLSNuyPV18EfFGn0pbeshan2epdAJhbvMwWqzx0xTcb/6qmfuumzN9KnqCy1JbbF9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348171; c=relaxed/simple; bh=JupO535FDJs874LcX2bRQiX9YuUvDP4z5KRR1MTFWag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jPBbWa6rRttuwOLxm+1eV8VQZfKMH6tbkViB2ZGPKdEFHoPMlmR8GNN59gFUbLsV/jSvEsYRGXc21ariKC9t3V87f3+mwh44VM2NZ8Q/isLKnMfHPf1XotpzdyO3F6pX71IXFaLifeIN7aE91nu2wZGHDdXSsle9o4zG+TuTnxE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uHRAPNgf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D735C43394; Wed, 13 Mar 2024 16:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348171; bh=JupO535FDJs874LcX2bRQiX9YuUvDP4z5KRR1MTFWag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uHRAPNgfAXAsch/Zh7PDup8SA1XgwNbmGPP0efN2VKV0kQOzxVnEKhXPJ2oNUt8Lx hBhVE8OsWLLs/OV6/9p8eRTyAgSYcXy929Z4Wh2IJOVpKY1Ym/HF4By/yPdZQp/2qx B5DNTrvMFXjF/va1TR6O0rnILicAZabe1ioQrpT7DR7wiPtXcVSONmEZOzrktB/R8u xbPlK4AtnpRxvbgNSrpwsJT6IxDz2kEeT10CelGDmk7XpGORcn4iY4nZaNsdv4R8C9 Yjx0+1zFVk4oXY7bcv9289ZgkNuhtXSDQAB16Htj4QF80+3ubAzkUSHWZAY4JO38zm Ug+M2De00r31g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 22/76] netrom: Fix a data-race around sysctl_netrom_transport_busy_delay Date: Wed, 13 Mar 2024 12:41:29 -0400 Message-ID: <20240313164223.615640-23-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 43547d8699439a67b78d6bb39015113f7aa360fd ] 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 5a5cca18ae0c6..76d66eb0de255 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -459,7 +459,7 @@ static int nr_create(struct net *net, struct socket *sock, int protocol, nr->n2 = msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_maximum_tries)); nr->t4 = - msecs_to_jiffies(sysctl_netrom_transport_busy_delay); + msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_busy_delay)); nr->idle = msecs_to_jiffies(sysctl_netrom_transport_no_activity_timeout); nr->window = sysctl_netrom_transport_requested_window_size; -- 2.43.0