Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1875409lql; Wed, 13 Mar 2024 10:27:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvqARZ5bbqZMyITp3xXeRdJaXr3krGOP3yyFdiOoJ9yX3tjlxnyKPvu2YR97FXkMJ4ULfLPEX2Il5630p+jMn5nX9fhupiOE2GOlGWfw== X-Google-Smtp-Source: AGHT+IFLhTSy1gLpOmEoPlHvw7oAyCtoaF8whxr65NNMQQUB2aBjkEiPPSzkaIHWWaB0IbbslvsJ X-Received: by 2002:a17:902:7403:b0:1d9:7095:7e3c with SMTP id g3-20020a170902740300b001d970957e3cmr12259412pll.57.1710350863627; Wed, 13 Mar 2024 10:27:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350863; cv=pass; d=google.com; s=arc-20160816; b=KBwzTnvDfsA8cuwa1GTPT0J4/MXxflD6mJ5CAoi+VTL4wegJC7Oj1aVjPabOFZAhjK BfSlpRFdbrklipA8uaxHv31Qs94bjYAn55ChNMzwK4GajJGEduPpYZPGLUMpYP/KsPBK 7IHQzps0BNCZ4q1zIiH3/uvh59iJAoOLCr/xvxI3iCaFE5FKSn0hA2aSFu9060z7rjS3 x3Z6zXJh1VeDnpOhw2EL64Y5HzIHd0t92Iim5mpUXeywfiRJavidNVqKPDzoaGz4xeXc u6KCtiz5U/0izSr7Mw1AcDzLBfitru7U7Uj+kzc4vJzOKv1Fo4jGI5cFP6waOLIRUUt4 +ldA== 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=hoEqe0xqeVs3CxVhtQX0WSiEgrMNN//P0+gC9Vza7RI=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=ffG8igLQ/bJ4p+km1x6Qy6ihSdRKKbFGEWgiGsrzzXaTHgNQXhMJjaOI+lBDI37BTD /O747dVfvpqxuV9sS3GNVfHccomdHXzzPD5ry1IgPQb7cziO/dzRRj2BLZbdAEYsoOpJ +zwhNERPYc9ROjm8ykDvfhWciL9O8G5IAvmczzCiu0L+2EtWLkoDpj+VZHcxjgYzKGe8 kLbqfMElSQBRLWsJEQkv7PrOjAlSCOWi+0IGyTxRxmZa0q5PeM7gHXKNfPj72S5njb44 DDOfPTERYCi/2+CCO/WnUHQ1gTl0dpOJ76bz20Z6kIrSLYAtG23wJU3ixgshhH1mJtoU Q6iA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="iRnL/H2x"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101960-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101960-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p1-20020a1709027ec100b001dddbd002e1si35773plb.344.2024.03.13.10.27.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:27:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101960-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="iRnL/H2x"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101960-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101960-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 15F3F28576A for ; Wed, 13 Mar 2024 17:26:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DBDF13D310; Wed, 13 Mar 2024 16:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iRnL/H2x" 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 22D3813D2E6; Wed, 13 Mar 2024 16:42:49 +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=1710348169; cv=none; b=dEh4oV7kvenDmI3OLhz1EVRQ8F2vMcYkWFjK86Sx57dTMRXRCceLitlrrRtLZVa6mwAuxdg1deUzbgNJoBPbDERAxccP8sfxy02ZFXx9W544WqLS6lkM74KXLWRmA4VkUu+p7SOrH6R+xMBrxuwwrQBZXA2lPWmXwptlucODylo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348169; c=relaxed/simple; bh=was6sneh7FZD+9dPqJzYCOv8b8gK1yrXIKN6t46lAZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VMJOQRmyle+BqPAuS1uhBJG9mOyIHBya6xWpxeCy19Vy/tbMG3P+OBvQf9GUbnSOwUi1fDDpcIPRMUxEHi9GnRGlIo/r8jnqT7htoUMoNq0DW8Jx+x8c3cSlCTlfcDwmNyrEB7v3zUUw8N4R6rdLdth4OsI1w8aPNubknRHtTVs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iRnL/H2x; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48702C433F1; Wed, 13 Mar 2024 16:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348169; bh=was6sneh7FZD+9dPqJzYCOv8b8gK1yrXIKN6t46lAZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iRnL/H2x4HOPgIuKXtreAVHav5RX4+ZBgCFgeQKpty/QIGtfQc3lJ9VLgDzaFC3Eq SnloBzhathjFiE+pIzmQLNRQOv3UBqKVvkqJ0RNgm4EcorLnrEbnaLnwc2TJMJzVyt 0DNdiS2VVy5bTrc73Cj9MrF4MOZB78rAasNbBZWQBvwtxvPcZLN/4qExHDLBAOKXmZ 8PZmC+heo1MR44hCU6CEzqOdw1GZrKl5SxjGYvA0j+yCBkcdlXKzXAOM4zXqmQ/tK9 e09z5NgOv2za78nWxQhXjv8MU5EfwADdw/T+Uj0fKxErt/ObkWYwnSV54MfmqqCD4s sVn0dlk6i5NHA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 20/76] netrom: Fix a data-race around sysctl_netrom_transport_maximum_tries Date: Wed, 13 Mar 2024 12:41:27 -0400 Message-ID: <20240313164223.615640-21-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 e799299aafed417cc1f32adccb2a0e5268b3f6d5 ] 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 6857510967448..678a7bbd84bf2 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -457,7 +457,7 @@ static int nr_create(struct net *net, struct socket *sock, int protocol, nr->t2 = msecs_to_jiffies(sysctl_netrom_transport_acknowledge_delay); nr->n2 = - msecs_to_jiffies(sysctl_netrom_transport_maximum_tries); + msecs_to_jiffies(READ_ONCE(sysctl_netrom_transport_maximum_tries)); nr->t4 = msecs_to_jiffies(sysctl_netrom_transport_busy_delay); nr->idle = -- 2.43.0