Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1872388lql; Wed, 13 Mar 2024 10:21:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyi7ruUvnqX16poDNUDloIT6MaDmuvOgV3MZlw2VtQp814f1+OlQ7qZE3h6IA9ZKJ+FuSFNotq+UIfG1YHschhDJk56+JCF56W3MdfHQ== X-Google-Smtp-Source: AGHT+IF9waaGBQh++IEH/N+dOr2WiJt8j8XP17ERED26srzjd3wBwGPgCc2/wznymEwgpksSnIh9 X-Received: by 2002:a05:6a20:429a:b0:1a1:4a4c:9f5e with SMTP id o26-20020a056a20429a00b001a14a4c9f5emr6341135pzj.49.1710350491215; Wed, 13 Mar 2024 10:21:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350491; cv=pass; d=google.com; s=arc-20160816; b=eTe77BYzUuDaCZ49dAMTFPwtXhmAZ/aSPiwJQ5ABZAlAH5KqZPHPOj6yZLfVCfhzRR xonE82/ea4e88Chg9PBqBzNmyG3ztBdvNVH7ZuQXSO+zk1Z7wppo2uauFxNdYaFNF0P3 VLKyKk+uER1xl1VcQkaAPiiuauvXM0/spSmnTxcuDWSIp8RAz7si5Co6brCGQ5EImmEv oBr2Rk0Db0+ujiOIPdSVqdGAw5XVqaQMEVYohDlh3WSGo5KIuqzsikLWqcDr7BVaqTLW emZCzm2DUiiUZymBG1jNOzglkHcFbAXR8Bz6zuR2CIjgzxWqayQ3/GsPu6gKvjZLPaus 8FCw== 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=NfrrGq0bSDRz+Fy0QEa9wFw33RWvPXfkX2cMz73prWk=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=WTMpkZTAbZnzvl2Z1jajmW5uEZdwM0hYQpPt+BBCQ6dhF4yx0j4jLeT0b8sEfYIR1U P+fmBWqaOFFMDeoNyDSNej/YuAJ1yYdGDGyNZnyPHnWsFHhPXXHD5FKqRMQc6uHBT27f vbTpfKBmIIdfc5PNETDOWImx3eOgon7Q2oAwIACISv0fpIB/VE013BCeNLnd/wj2qNen 1OFMAuhYUzeK56lmu5FZVGzPWxOfaBj1B2ODCiIOEl/VnNtqCYB6doYOmFnaIZWdcLB1 QJcOWBv8+006ejQtOawXknmveTTcNcEBY/fvZpZpQQpSlL0WLsiUiMUuRz0yCU6uRk2P 5neA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HB0QV33N; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101894-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101894-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 n8-20020a170902d2c800b001dd0803a2fcsi9811321plc.58.2024.03.13.10.21.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:21:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101894-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=HB0QV33N; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101894-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101894-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 435B2B21831 for ; Wed, 13 Mar 2024 17:10:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADCA17E578; Wed, 13 Mar 2024 16:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HB0QV33N" 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 D4AEF7E0E5; Wed, 13 Mar 2024 16:40:29 +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=1710348029; cv=none; b=udAYHufF54aP73Kg827re81fxG5RijI+7lOwn5fM7uy8mKSICQ6R9nIGojJqV+nm0VxtK1v28/FYzDl3g9EZpmBdFKq1JFvCQXJmnNT9ecyUlmPqaC7r+XXHpuWTqeLPbKkBYyh2oYLG1a7F1iz2K1oxaEFtfXAMD9N0K8/k6R4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348029; c=relaxed/simple; bh=Ial15X+T6x046jhvrw91zfjdAqyEhkULXa9p2FVOuBY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uXzY7C/PF+0PhOMmlGiNNh0M1XAb0ZuijBvzNa9bs5qEhyxFptlkTGbxflsU6zHqZJ7tSoUQ+0RhsBu/Uk3WicL6VWFA3AwYUg3bqK59Kth0Z5bK46cLGE8aBdA0MBe0hf2sWkL1v3WHeALg/Ik45+wgP+nyyXacTK7MHgTa3Pc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HB0QV33N; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0746BC433F1; Wed, 13 Mar 2024 16:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348029; bh=Ial15X+T6x046jhvrw91zfjdAqyEhkULXa9p2FVOuBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HB0QV33NtH35jlWYTQDofpmBYNj4YHpl1tKVBmy8urTt/yUBqxHYhLh5E3F88R088 ZeOF8mDj4ybrrPABO5wbWpiBDwJQPHtgYBbWlqDMU7ULbEXR88LpzubqerpSb/KqVr 8na5nc8g2/5bYWpR1dyLmiNOSRC5jf8rmgljWhCxRNtX0jhe+CHWDdLtg9uYQIjX6d N866qOikWjSGwgl+RloJdXznqijVk0joZgYndioaeJTY4mEuPjoklCc0nfb1/uH3J8 a0NNzficEvQKYCTkocfZL6SvkWkk1tfnO85auGGW56viO6FLrU2PWE/x8rZOhx6i9X CcQ3FHyR8UMUQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 26/71] netrom: Fix a data-race around sysctl_netrom_transport_requested_window_size Date: Wed, 13 Mar 2024 12:39:12 -0400 Message-ID: <20240313163957.615276-27-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 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 ee6621c0d2e45..88941b66631fc 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