Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1905722lql; Wed, 13 Mar 2024 11:23:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRhoRhMdx4ZRouhrMR1Ii7hTBWNtn1tnRXIISs+AZDBwEoYseMEII3jTlw06uFoM15+6co4o2RVelW6xq+RQekoU+fpYRWPMbN6ZKA4Q== X-Google-Smtp-Source: AGHT+IHGigfRT0s9EXd/ge6FzyU1fXQqz2g2H1LOHaQfNzYYh4bgtjGJLKRB+USjwGXdpW7molH8 X-Received: by 2002:a50:9998:0:b0:567:1bf4:a189 with SMTP id m24-20020a509998000000b005671bf4a189mr3371217edb.13.1710354238536; Wed, 13 Mar 2024 11:23:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710354238; cv=pass; d=google.com; s=arc-20160816; b=nxDmj0N4XXQp2BMV2XqorRnwbc+qrtZAiuccfa/zWHvG0HA+Je1zxZHUAP4a0a05KP SEX6EwJYYVCKhD3C90dCb4rscE1awR2P8jlMjT5ntOrCQJdStX0xSp2HpAOCM/0Geibk aBOregUXATFvrfAKQoVQGQ066CNFk5v+wJW2fhu7RPWWU3OFmpNpC0xqzm1fWFjt6Ddu WGSP3wMdQjceetYgtOa8jGkkeYp/NIiADCSSRENpwAOH7PuWsZXf/KFW3JOKJawHvk2w XZLnBaixXsk7JXwWG+WH4ek+GYgDy4qwNs3QCn+46mGrtGcmsllZ2J6eLOgzRSgzQ+8q 3Kzg== 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=HJE9pMtshUc9zhdYIkezYuEboBKDDqzjwxXbYgXrkaY=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=lLHtmMv38KSWSF8OqzsdTiIyNiPM6cn2HZ01IKC9rE30QLdSZK+xut4+VmhQ17r99f MpelYmtNia/jqWwyVP7h2UbojDWxd7uAnX/CfYWs6VGE3d2Xc+q1tSNjmS6zKrGKnvau K7vfNQ2wsyg7cGh9Kco1usLH2QGxcD4xyaIT/1hvEDJD8iD++/4Ov0kkgYV3aKD2RrhG Agd0mHUAnNzrohEp00Gk+LLZakIjZFjLoORxp9LjRvIWP8yZwmMXcllCB23r2iJhaPwy YK0ijQfRnaxWgI/wHXSHyx7OKDNf5akiz1cFvhMagxtocH7ZxQflMNH9Ix6HXB20QUk0 2YkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g88jpvLR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102051-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102051-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 n10-20020a05640205ca00b0056651fb5ef5si4685186edx.288.2024.03.13.11.23.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 11:23:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102051-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=g88jpvLR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102051-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102051-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 C2E731F2C152 for ; Wed, 13 Mar 2024 17:46:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4992A154BEF; Wed, 13 Mar 2024 16:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g88jpvLR" 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 675E915444D; Wed, 13 Mar 2024 16:47:10 +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=1710348430; cv=none; b=BKqQaXj/iARePecWcPhn/gdML7aL2yGkDQEZlOPfYhl2QIZ+YWJiDNiV8sql4SeYRanMtLGKCi5htexDMp2zw368R1aNYgjuOvPzWyd6iq3dY/Hf/eIs7DFn4X7sxkYLO7gF2cHs/zvel0jpzjGJ3+ZgdA+nNSgVTs4K40Vl9o0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348430; c=relaxed/simple; bh=A45mpmaNrioN7F+79MkqmOhHiGCPFpIHmheKJHJxoKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rsSIwtXZuq/tllNNlnU+5KSqSKGmWbZ+82XSFPSupKru1Rb30wfdI1o6joVT+vEL5HlqtcXA2XVMr3856cZPo3bZ0G1iInr+cp01Zx2IZC3Pf8wRbmMXHJ5oaQx1mb+guYNrPbHaVVXjLhDVXGoBNfZndAhesmkcgmNJVXjUbjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g88jpvLR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59681C43390; Wed, 13 Mar 2024 16:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348430; bh=A45mpmaNrioN7F+79MkqmOhHiGCPFpIHmheKJHJxoKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g88jpvLR6tKhTBWbGNgFF2hbEGjp4KX2srpjz65cWW/+AwdWa4kvAGavczDW5tkkw GTYhh+KCjEr6e/wU6Yqsd0E49VIYJydLKpgiq+7AxzU5ZEd4c6YiAB35ZE7zqOUIwc R8A0IbluzpJQyvyWia+Cy1pqvcbwMakXrjtxfhfsLEacv3P13KQaAX+ezWPXNLsKzB ANEXAzRT5+z0PJ1b0MD2QpaNvtoKvhQGg1L9oPTDyvJYTNdKzuwT/kLt52LyIheWC8 ah/4pX2l52E/lNkpngep5h1TEWTgIkg/D2MhPpacuJe7Uc5/yUpbs7cKek7JRY6Y7O ntxVORayo2hxg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 5.10 25/73] netrom: Fix a data-race around sysctl_netrom_transport_requested_window_size Date: Wed, 13 Mar 2024 12:45:52 -0400 Message-ID: <20240313164640.616049-26-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 a2e706841488f474c06e9b33f71afc947fb3bf56 ] 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 76d66eb0de255..d780adf54e19e 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -462,7 +462,7 @@ static int nr_create(struct net *net, struct socket *sock, int protocol, 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; + nr->window = READ_ONCE(sysctl_netrom_transport_requested_window_size); nr->bpqext = 1; nr->state = NR_STATE_0; -- 2.43.0