Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1871281lql; Wed, 13 Mar 2024 10:19:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3JAaVKCEXO3/HG3zVchOhW7SpPEwsND2HJPfdW0DUdjcyl9IsRB8N44R/rU/cU7HRrieK3ab2ikk2rIU0qBTE7CluysmUPC/W5yHYcQ== X-Google-Smtp-Source: AGHT+IGqX9uLOoIt6R0KKYLMZ4dcBRqNLXEOQdHUqJcb+1E1rWLnVSH6qT488/hLg7GbZ0cstglw X-Received: by 2002:a17:906:ba8f:b0:a46:3785:4adc with SMTP id cu15-20020a170906ba8f00b00a4637854adcmr4247166ejd.57.1710350370300; Wed, 13 Mar 2024 10:19:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350370; cv=pass; d=google.com; s=arc-20160816; b=rn/PlVQpfEiaBGMzPvaZjasSuLmzeHXSBKfaMPm5hxW85rEQ1s2ruZqhTCVZYEZV/Z zjaIxEv0XfdA2mPAvBaDc1k++teqLlnEsKlWBmgEDRwteulgL79dWY2YPR0+ZHr/jE9X NwwE8wZSaS4iWFgn+j18gGBpG9GQnsGRmQRjWnVBxwg9+c9OVcIx6GN3pO1kK0mPqXSF uusPOL8+c9XKEDu30RP6ADwvMkBliBFkL1BpI1N0n1P9A0g7QBA418LoRzA2l8PTJZMb +84ZT4a4nrBvlJ4uIkDllaP4bC5lL55g3qkC7UqmZXkn2o13RXDw2nUlVEYolZ2Xs3mC 40EQ== 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=67ZH0uZstC3zLSiL168Ejl5Ut1gXmosPNa1CSkHc+cc=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=LhogMBEAhdyusRiwqjtIBqH96jhSZJs+ymo2dG8qyaitRWBM8dC2ondkbVG9xTtcb5 pZc7bGsAQ8m7oIi9mjWo4bL5P4W4yLfrgLDggRPP3UcDGa/qXmDilZPVeNdCS3I01z8N O8m/wvaEdwXAKSOLoqNSU0A2CWJs909xXihRLv7nnXvbSB9u3RDJQgML+iehCtzAJhMH hAJtyErFWtO3JPTamkEpX/omYct92/S47wypRwz3nttAR0SxkNY8d9YnjxrNFnHeqTXN 8U0t3YJdBsVbA63c3SbeM7p2jrAE69k7VIqOW735Z8UywQa8Y+omIKd3o8t4kF5SgL9o /fGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TbDPEkLH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101890-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id br16-20020a170906d15000b00a4659b63871si783338ejb.668.2024.03.13.10.19.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:19:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TbDPEkLH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101890-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 6D8671F2C01D for ; Wed, 13 Mar 2024 17:09:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7A014F602; Wed, 13 Mar 2024 16:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TbDPEkLH" 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 CEC307C09E; Wed, 13 Mar 2024 16:40:25 +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=1710348025; cv=none; b=rwjpSmeUBrll8C7hu8m2ePFWCxbVwt7qyrtWNMP08XJiVAkfO2hkDcRuMCjn7to89HhxLUM6dHi9TvnsilPevFSUcrTiCBzW3jzLzBE7BdYMWIYDN++poELDnhbzYptLZhcdHT2LCZl/yyxegjRXbmIKfb6PztEJcvUcQ+VMyVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348025; c=relaxed/simple; bh=yK4X/3XR1Lzhp5H6UeOTWzpopfJQ0x1XorGvpfCex4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M3o5+fYB5zN507TuG01Lxn3CKFTVmRLqPKCiQPWOj7eg+rwBZuMGgyQeJIADXDcJz2JekiUyRB1VHjxQ000Jc9PS2aVCRYfyWW/L0QjKI1G4coLzAEXoNQNha6qW3cFp0qMNJXa5bc8ZOMbDZe97DG4+kkmFkmV5arisPX7BAV4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TbDPEkLH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1664C433C7; Wed, 13 Mar 2024 16:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348025; bh=yK4X/3XR1Lzhp5H6UeOTWzpopfJQ0x1XorGvpfCex4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TbDPEkLHazbdl86EaojJ2CNO5pr6rMcPmhHXDqz6Jr9/9BHnNOjpAQACw9ePoJQ/k okhdSLZ/MCgCidxRSLdfKj4WbIXGzLh4mIm+AlViyYnZynbm5hbCpqn1qxCBQLXBnG Z0uKH594v6HGp1OS9XZVOCjeJY8i+dohzL7e+++TmqAMMxmqVaw67gi7yeR6HSex3h +EVf5tEQSHXP/AENPa19XSzmYxgbFXZ1wQZIr+7Tsr6fz+AKry1G2V0o+NDJNrqtJA +efbxDNpSHCRBumGziVb9B+Ofe5JtJoPUt4MEsehRxw9ERQHvBIVkZXbB4Y+zgqhZt BgC3Imfv5sfDg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 22/71] netrom: Fix a data-race around sysctl_netrom_transport_timeout Date: Wed, 13 Mar 2024 12:39:08 -0400 Message-ID: <20240313163957.615276-23-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 60a7a152abd494ed4f69098cf0f322e6bb140612 ] 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 ec5747969f964..3c6567af2ba47 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -453,7 +453,7 @@ static int nr_create(struct net *net, struct socket *sock, int protocol, nr_init_timers(sk); nr->t1 = - msecs_to_jiffies(sysctl_netrom_transport_timeout); + msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_timeout)); nr->t2 = msecs_to_jiffies(sysctl_netrom_transport_acknowledge_delay); nr->n2 = -- 2.43.0