Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1855904lql; Wed, 13 Mar 2024 09:57:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyKlz5JNJ7V3CcqWvtbSGkNx4uxuRUi/rhJNM5AhGoJv66jru+TOjPi+wBJ4/Q7gb2HP/7VfaZC0ISeSa3Irmdi0ozsxx0F4H1dSSgfQ== X-Google-Smtp-Source: AGHT+IF9yqkN2UX+28zIXYlyD55MELBfHqueDN+FthaKEbT2J5TzSzmnaXOGl67rT54uGi1rX37N X-Received: by 2002:ac8:570d:0:b0:42f:584a:5e72 with SMTP id 13-20020ac8570d000000b0042f584a5e72mr6189126qtw.1.1710349068817; Wed, 13 Mar 2024 09:57:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710349068; cv=pass; d=google.com; s=arc-20160816; b=Xz/GClCXN9rL+O2FEhRrZXSycNjYo1zFPWO4KihZYa/tDRLMqsWoxHS1yHoB0A24yk 5cbNzAeJL3N6klnIRaNn7gue7e+Tu56k1pZwP0ww1GYSdxCeHJGZQqV5cDeFXyJRhbHb yJcVqWeevjGMjkgzgb9j1z5GpHjplafz6D6UzIUuy12ws8JeTHWLFppF0TxP5U9GoV7c SN3eNEfWIF3xtyPRabdS4X4L8lbZkqmmsZWSA0ffLz6c/8pg97cFyiNa3kaTLHu0Kv5P GHiEu3swCmK/RoQ8e2W5SiM38Qr9cioVPaAFpQBbbFYwP58SYTo03+d//fGvSSUB5VAD +Ctg== 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=diHRocfuqxJ/apuIUe92ENHEzv/w5ZcrwalmM36T3w8=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=mikC4DiUWTo1vbIZdN8S9NZup3NbTk7ymMCU0aREBsjSLiFatApUIOJFEtl2bQMkWp J2IDLJC3ymgTSl+LhAPqOMZ4tEr3chDlSLMq+k3CSt3KNWKBxLOAa+NWua75UiVV5Y3e 6/RFDJLKol+Rbf8XkmuuwRIV/qZ/nf/rHljqaMx8JSHabr6/gJ3u4m7CuPLM3v3czxj9 enVUANmFknTANFCW/H07hP1/ZLn+GbnOC6xQZ5qZHuEzDqbDMgpIh9+5fElllHnS09td 7+hLkEPw1xzBxFk/Kb8ilaykxff4tjn0/1onU1zaw9PcXiy2Me3EjHk9gDur2g7KCefN q9CA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MZqpYqrd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101844-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101844-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. [147.75.199.223]) by mx.google.com with ESMTPS id z20-20020ac87f94000000b0042ef82bb7d8si10425729qtj.506.2024.03.13.09.57.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:57:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101844-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MZqpYqrd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101844-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101844-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 838FC1C20DE7 for ; Wed, 13 Mar 2024 16:57:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E46B7316D; Wed, 13 Mar 2024 16:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MZqpYqrd" 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 3E22D71B4B; Wed, 13 Mar 2024 16:38:00 +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=1710347880; cv=none; b=j5f1iUByahC0aPw4rtDTP5Nne07q4uc+TWFoy6M6Sma7UlpMYwollw3QEQCfYHf99UrNIopEDhfOaEACFfumWGIfMNLL9E1tKr3AFfdU9Z/SMWP+HBj7qg6KzZGrmYqsuojkgznEkDgEpkwiDywoxm4Y8aLrNx+29cfiICCDkKQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347880; c=relaxed/simple; bh=YUm75QyIDWrVxc/dfGrc7itiCpP7JcwKZfmQ9nq70qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K3VHWkcLP8PQ5OgBNTNQ+wKbuhPXZGhD3tx54ZVM0XW0jQimnGwLIVyt0gb8Mw4DX9ZyZpbGw9hb1Jix/NsO5+HseU1BvajTQUtSXLd4rcpZBIIDxKyEtsMhUVH69xHHN8R6n2wDp4M9O8lvjQhYRMJNrt1rgzjJl6Y4OIEobsA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MZqpYqrd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6226BC43390; Wed, 13 Mar 2024 16:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347880; bh=YUm75QyIDWrVxc/dfGrc7itiCpP7JcwKZfmQ9nq70qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MZqpYqrd/AbCoa1xuY0lHUCLQ33xWnUwpERrx0QNl/qEg7H3GtmEHpK/TFakOW6Se t5RWfRAONZ+PeGw+uP+amB+r+u/8xUIcWhoE3eqttXFRSCPbcCvz+Z5/XkNTozn1XU 9BY1pR2Z2wBfUL4zHhcnGgWUF66nlYDHy7aZPhxIDIMSpqKPVb0FuNWFWGJoETT9W0 sYbH26MDzpFxbnNlEQsMhrN3omLx61E+Xndv/UqzP7/COOlR640wQOQnBGOzvtacX4 s+q3rEzhyUlPcoBAvRkWcEph5AWORxSBdDFrZ8GmQ/TDo8aiMp7pHBSKRsdphVC3rK 08tZ25vY3UsKg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 41/60] netrom: Fix a data-race around sysctl_netrom_transport_timeout Date: Wed, 13 Mar 2024 12:36:48 -0400 Message-ID: <20240313163707.615000-42-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163707.615000-1-sashal@kernel.org> References: <20240313163707.615000-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.6.22-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.6.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.6.22-rc1 X-KernelTest-Deadline: 2024-03-15T16:36+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 96e91ab71573c..d8a25f614c500 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