Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1889938lql; Wed, 13 Mar 2024 10:57:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqQT0SbVkj+roXpkm3/mu2kWHnInNaKm8eVF4hFoNfwvPX4fO+OLpcinU6BqsH6agC8rMItEr9Rn87GohVucw/wRdBb/0y/l8jyAVOGw== X-Google-Smtp-Source: AGHT+IHVu+nW4fZmRtSQgfsH5NFuy1M9BpiCb3hG1UaWQnTCnXCVLFVjRZNxR9PDYCg9iTAjaSQm X-Received: by 2002:a17:90a:6986:b0:29b:c9ac:c563 with SMTP id s6-20020a17090a698600b0029bc9acc563mr3837858pjj.19.1710352676498; Wed, 13 Mar 2024 10:57:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710352676; cv=pass; d=google.com; s=arc-20160816; b=pATWyCF5k8NCiFSGbKB6AN8ANYcHeE7RNMwvxdMk5YB8HYESLLiAUSYaJxNqpUQVmu K5h00mmRhk2wm7py37fMkldHAvTl/0+vA3i0htXGphC/tEHyjhT7Af1iTXOTJlumOea2 fnaRcxBwV7Kc6IzQ2XnuXMPV9KFYswoTbGOlumfHKeHJBcqsV6VfdfYeHLbSqmMrRcEz qYJ7iBXUcmJGTyGJghsunrikRIs/A0WgfA0nSFdiZSBaEHN3K/JF6RW0NMEs7q64hxzw rijXQ9pmkWEhOJKmlrtWtbj44/lbfihmR9DzEkZ6iYwWG1GTgeaeDEBYgscV4KOLYPut 9Akg== 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=Y03J+LuN1+Bn8DsJTwV0yvwRpblgdCZ8HMnCrMjxbgw=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=Oc5pP1YMpEyfSLAIL+I2gP3n92FlKOHvovP/d7Rd+l5ezl5AgRxSVCWLXdiOUjsruB jhi5VHR1TTqvbwH4qSzkWRWySEQQKOTeSZ+rE5XLeeNwxj223EfIZAyQofwEFXpaAv/T 219yn9rkeTEHdBd4caJhkDY6JwVUxc04HPrQ44msHgPbVjNQRpUkGqd8LnxHlpHA0Msp ZNwXpx5X9jfJ7jneUnjbxN+fltc6AwnmuVtV2yWi+4syKkfBdA6YHfVQmKOD/YEbGO/g P4R7WVW0M0HDIiC1dF+IfWNIXMNzAAEr6OqYfF2TNCjpbPXKe8BhMLcGLMgauO1jvY5V 880A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q017PVcm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102049-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i15-20020a17090acf8f00b0029a1861c273si1877146pju.73.2024.03.13.10.57.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:57:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q017PVcm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102049-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 5E235B23DDE for ; Wed, 13 Mar 2024 17:46:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67C21154426; Wed, 13 Mar 2024 16:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q017PVcm" 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 86AB21534F1; Wed, 13 Mar 2024 16:47:08 +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=1710348428; cv=none; b=as2FXuLY8PRTBjPZR4Ho8BZF3NZUHKYsotLUj4cDMYhRAMv8cyv3493AKD2EYkvLNLrXvfUoaFHzDIP57+OcOD7pyDMoAmtyCe0JWJjDaMliHP3TUA/FJ5H0f2cYOwIH5SfqfFNKH7ObIZkVXtVSlH9naTB7ZlYsfqnlK3Fv4C8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348428; c=relaxed/simple; bh=67liw3T/StQ4cXBr9axLBR840ACqH5dgsHUqaBCJwWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QiW5Dg7dEAd7HvT4LxXLFYBeeIw20EVa670UYsGbZRw7DqVarHwRSkYJnkz6BFPrEUSOPDcjgF6bDsvDXCN5KHKNJBP3oVow9s6K9U5usHpcRWH28WYiv8lzl/HreSKmbS1TXw29zZjMZf6LabmrymNlGwao+8YTSN00/6MTRdw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q017PVcm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 596E3C433C7; Wed, 13 Mar 2024 16:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348428; bh=67liw3T/StQ4cXBr9axLBR840ACqH5dgsHUqaBCJwWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q017PVcmPg69PTTrybF/umNswuo/WlWcgIwCBhuHiQ/PdSzzea6vXsBUpQ2hS9RZU OMs8CKJatV3zExVs4UU0c0OzoDdNVo558onmZO1JYoacOhHIx44NsRHO8LCAdAD5Ai U9UMiV1zDGFCYLAmk9pfznR3yzvMEwriacleMMpzLBodzs+oXyC4VrbfrZO3FyAn5h PWYaejvBVFU1bBS+m8XkPLhCxQJEhdgVbnyMf0b35ct+p0qII90Rm8KOmEz+tBnGp5 ROXnxM8rMYx4eCS2MvhEUlA0JVGeSG3K8L4oGtbNm+mabS6q60uiciN5jx6siTgdY+ oaQzaKi1t2kxQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 5.10 23/73] netrom: Fix a data-race around sysctl_netrom_transport_acknowledge_delay Date: Wed, 13 Mar 2024 12:45:50 -0400 Message-ID: <20240313164640.616049-24-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164640.616049-1-sashal@kernel.org> References: <20240313164640.616049-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.10.213-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.213-rc1 X-KernelTest-Deadline: 2024-03-15T16:46+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jason Xing [ Upstream commit 806f462ba9029d41aadf8ec93f2f99c5305deada ] 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 678a7bbd84bf2..5a5cca18ae0c6 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -455,7 +455,7 @@ static int nr_create(struct net *net, struct socket *sock, int protocol, nr->t1 = msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_timeout)); nr->t2 = - msecs_to_jiffies(sysctl_netrom_transport_acknowledge_delay); + msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_acknowledge_delay)); nr->n2 = msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_maximum_tries)); nr->t4 = -- 2.43.0