Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1849745lql; Wed, 13 Mar 2024 09:46:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVmZCk6YjrhryJ9SFog+aNEYpyZ/26vzXOciaUsaWP750FJYQmSEeIQwAbhQNPlSajc3Yhagxb4K3nUyld3iLd7+M10ZsZPhOVB7+1UUQ== X-Google-Smtp-Source: AGHT+IEGlmMgjWCSbdmb/x2qK+fwZUrY75mtwVNoMZNzvbxdjRZZL0o53LymYbxtdoJ/6Cc3U2Mh X-Received: by 2002:a05:6a20:3cab:b0:1a3:3064:993d with SMTP id b43-20020a056a203cab00b001a33064993dmr3244919pzj.12.1710348385921; Wed, 13 Mar 2024 09:46:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348385; cv=pass; d=google.com; s=arc-20160816; b=acCV2ukBM4vAXGn8xFqMqkDmlCZUEN1J26Qg31RR0UeUrcV/g2uoduw4sl5BonAAcq tOLwMbqbwPwhBz5tD7UP/bHL3+L5o9ENfIGp1NTNIKhk1xZ6kS4FC0wBxkKU1M1cqFWc 5/sT1wR2QWHaN5P3RiEesK4+h9vVpwLfEEUlPBwFJHVgQ2adTBTkAnjc3eDlk8Q+vdKs Cm+8v3VG3g50RwiqZBemSoPfPcM0NdgKmx5wgLWo6617GnRh+X/kqeKYn2Y8EJMa2Tmz FLg1C5Y7Iixj+fXxESARiOYmt+1SWCF++y0snssDZqCSMMKfIDlRaSYL6rteCLt0RDBD PqOQ== 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=YXol0kHazQe7Ze1vBB1Bn2zdU9Yk4MuEDtTOKntlgdQ=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=07M9B/bOl32fqnAyNSVroaYfh0kkajUTZn++EcbT9UZzoEVhzLxilvv9LfdyFpbpK4 CP2sDkI542uKKK4ocY3BzGKiz2g+deL9Iu7Yl1ZJUy/b84Pw6cWG+w5bfGfzUQgT2blB PlMIfyVgxqXcP7vDGEpdIIjXhBzjhVPUBPgZfndwtuaEOt9Kns+8rhZaURdmk2cXJmh+ uKpuzOEx44/EuUYfLffOCkyOB/uk7+k5U5tRX3XlHMOZMPHBkfGc5LIaEnhc4IijZU5S DFTvIp0yjD6ebnXy47H1j/3F+WgHNcoSZDBSasRyYBdtsIqlcCjwKzuHTkNBfYkTDfCh P0pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dbt+ixMJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101785-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ln21-20020a056a003cd500b006e37410162bsi3756451pfb.56.2024.03.13.09.46.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dbt+ixMJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101785-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 AF4E5B24510 for ; Wed, 13 Mar 2024 16:43:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 263A763CAC; Wed, 13 Mar 2024 16:33:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Dbt+ixMJ" 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 25C88634FB; Wed, 13 Mar 2024 16:33:34 +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=1710347614; cv=none; b=PJTqFjr4heHVgN0h/Hx8cOQMrrYIQK1truIpy2iJUkgdKCa0cHXXNTqEtuJ2vrcaVPy0HFCUTqYkOU19Ln5w+Nvz44tI8xvLtakSf3Jo0Rsmj5hvOpZ7futWiPQUaeVhn28r+BrLExDjhy3I+ZQuhK/ZMu6U0rkpmTgdCDn5O+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347614; c=relaxed/simple; bh=kCnXHqQDsjm1X8vpJNNRhno41su6alHx5R2Ic5AFIDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F1U9ZtQyrQ8xMtkeqrJxtS7tYr9RU/t3zejLEmsqgh887uwzhHfhm5POPEAmP8dU16M/O3bpiZYqSWbmkqW0fpGE9qfZB4E1TBgTxcll1jLO4CxUXFTN9thI30Bl5HDHfvkrujQFkDrJhzNBVcrN8EOIRUpQXeAMpYyQyC26pWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Dbt+ixMJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40C29C433F1; Wed, 13 Mar 2024 16:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347614; bh=kCnXHqQDsjm1X8vpJNNRhno41su6alHx5R2Ic5AFIDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dbt+ixMJLMyi5//uPFz3fTnnh5F/9v/odbyJpubPxOaMDVggryaRc3Y6IhW60rAhk dw5hHS27kvo+bnvOGhiGdgqJ4de9KV84DdB005VgI8ohF0d4kMN2vROCT/BUSXxIVO +oqwsWwygCEhnw8VXYAhGnInhgHFIkHlWvvD7v8vnFyfpg5f3+NTcUYrByRMjEb9vb 7axe+GvjgLDSZlDWcet2lRw2EUGgNmcv7FCpYPCwx1jl0jGqLZjF/YZCSpAxr7lly+ zqk1eo5WUUewNDh83FLTrQnk7yiKwrN4KvDa6vGT/WIgZiV1eDQCWvXvp8J8fQdifZ HwtFkXsG6AzAw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.7 46/61] netrom: Fix a data-race around sysctl_netrom_transport_timeout Date: Wed, 13 Mar 2024 12:32:21 -0400 Message-ID: <20240313163236.613880-47-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-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.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+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 0eed00184adf4..4d0e0834d527b 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