Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1881226lql; Wed, 13 Mar 2024 10:39:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXO3ck/+MIGvfTRqrrmVNNMuQJgLdvXjr8z6GCB6Fo0zBfOQQwBH3ZEGXm07FYkLauxzP8dxeyyNLnXD836g5cV1ahuNSCgGxFw3l5KDg== X-Google-Smtp-Source: AGHT+IF3WHk4Lva91IclyShvih6A22tfjLihZyucuX4ElOKmZ/rcLJRIzHogwITUOwltWgj2tw1G X-Received: by 2002:a50:ccd6:0:b0:565:cf:2566 with SMTP id b22-20020a50ccd6000000b0056500cf2566mr2734000edj.12.1710351539887; Wed, 13 Mar 2024 10:38:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710351539; cv=pass; d=google.com; s=arc-20160816; b=0xgLuonlDzWuM580qqOj0ymdjS+YMHpM9ynUpcHj74EXduv+WlYo0HD7GBQuEFdmkD OOnqgyQlZpxAo8WCJBLbeKVNteftFtVqdeEGwY8UTXP0A9gZBzMeyMMlJYVs1nowa+0z KZmx7BvYCv3pn85MX5AEqk1u05RFYp4/55L1S11ZYiKSlfS5Vh0UMmkNeNCTDQOhlurc y0G44mMkgZlGcH47EpXIc3w8BpB+3mNRbthMptLGgiX2lQnANgOinQzS4kGBpE08fiZG 08Ic3ChS1tqRlhETMhk7OJb5pjOBTh7cK5fVuXFaPr9Zjv7Z7y476cYs6RXzUdqThA67 wgMQ== 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=Up99qjhvXnrimDiqBoBXvZaODsY0jMiWXLRgRvbagbQ=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=jj5LpvM7Nr4+GMN1PNd/m42uLyszU4yQnRWvcQCY5F8man6S72y7VCaR6eFf1jiCqc BYVI7tTePHHP/8Ltj/Zmw3w3gkQxinGxIC+mjyL+HHYfd5n1THd2z5UHfLU9J7rKLATP lEHjUHsR7xOEug/cfAFY7W++COCpfFShZAMdEu2kxjuvm8gJaJmZMY6U6B97Snhk5XQ3 CDWgpWTmKTE0jgM6IpBWLijKMmCp5+Miuv6nPIH6kaQCb0cXcDOYUCZz7wm7iIKyDLcv 02PPsEcbXkac1tnP/4nRCIUxbB3wvMPP+AEOEpJt1+RhhQz67uGF1LmA+CM8h6xMu3RN H1Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=la5YW2Gw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101964-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 b19-20020a056402279300b005684f7b073asi3752382ede.365.2024.03.13.10.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:38:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101964-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=la5YW2Gw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101964-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 57ECA1F2140B for ; Wed, 13 Mar 2024 17:27:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FD4A140E23; Wed, 13 Mar 2024 16:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="la5YW2Gw" 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 29154633F5; Wed, 13 Mar 2024 16:42:53 +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=1710348173; cv=none; b=LX97koj31RD7tVug5MVEQi7sTCopAsIgUC8a/iwxn3UP+1PChoDnAYi/ozktp5xRvl1QHiKgF3y1RHZBTN05T21qsZlFwilhzPhPkBSNEeh5Yipftw9euoM3GX4r+2vYHuOSzEXuCaBKMdvDmke/b3CPhxu7V1CPbt4GDQzLC24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348173; c=relaxed/simple; bh=g43Mh+Ckbo7u84Iinkv4s2Oe8nqvUxcd3wBs+YIKlwA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TM0r0cUgGSPQ/TArKtTiodC5ZNVknn4qUegobK8GaGBPxKCR9mB1uazhmHB/32/4Zcec5vLpUuEXKnGWLD1cMmapye3aR62BZuyI5L/+YL6iiQ+BOaIP5FyCwdHkTzNpO1zwbAzX7Af6emLrKMVzoBW1z8p4OSyAiu8TcZS7XO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=la5YW2Gw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D3BBC433C7; Wed, 13 Mar 2024 16:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348173; bh=g43Mh+Ckbo7u84Iinkv4s2Oe8nqvUxcd3wBs+YIKlwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=la5YW2Gwq7KIqMxEjxF7c/kZ87AVjgcIBpNpWbtJPjL4uzpLoprd5PJh6BLojlpg0 8IQepAXmSGtLmkNgxITlphRU6uvmvJpcN1YHpPqHOhcK9e2o5m4eJe+Ln6Qy408j1i gSrTx10zOE9P3W2oI0XuC9tfw1oU2nN9FL1e3QtYfdRNlyCj8XWWMUpUKx1m2QZblw KcF7/vNu4kCXFOZzCyW22rr4CtXEPXjkRaAbJnWtDUlQkix+LaDtdPX99GGFeMrcZ6 8YnnH/z+2irlqqc2udKnRqmagnWaSVlgkmUeLMMWm9d/R+ijF3MJH9vxLlWStmci7/ vhx3k/gntSiDA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 24/76] netrom: Fix a data-race around sysctl_netrom_transport_no_activity_timeout Date: Wed, 13 Mar 2024 12:41:31 -0400 Message-ID: <20240313164223.615640-25-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164223.615640-1-sashal@kernel.org> References: <20240313164223.615640-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.15.152-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.15.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.15.152-rc1 X-KernelTest-Deadline: 2024-03-15T16:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jason Xing [ Upstream commit f99b494b40431f0ca416859f2345746199398e2b ] 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 d780adf54e19e..376b6af431448 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -461,7 +461,7 @@ static int nr_create(struct net *net, struct socket *sock, int protocol, nr->t4 = msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_busy_delay)); nr->idle = - msecs_to_jiffies(sysctl_netrom_transport_no_activity_timeout); + msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_no_activity_timeout)); nr->window = READ_ONCE(sysctl_netrom_transport_requested_window_size); nr->bpqext = 1; -- 2.43.0