Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1870670lql; Wed, 13 Mar 2024 10:18:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURVeSKZG+zINHtMkEFxj6mR3E0iUzZI+QLBYN1WncwB3EmUGx0vFhdocBIZb6dAXFjL4aCCrEnBxs0Tu1oLiHxqo6pyl3Z4Ypx9EYWrQ== X-Google-Smtp-Source: AGHT+IEVEVioTS2uXG2mFITb/NzKDcNux6I0QExDQjmqJQU9eON06xNCRHLeq/p/he0HV0y9qIAc X-Received: by 2002:a05:6a21:2d8f:b0:1a3:3547:cc8d with SMTP id ty15-20020a056a212d8f00b001a33547cc8dmr1561883pzb.30.1710350301757; Wed, 13 Mar 2024 10:18:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350301; cv=pass; d=google.com; s=arc-20160816; b=fnDU7ppvUXVUyLpVtlRg8QE4BZucKmjlxXvUaMI2VDKWLNc6Q2Jj5RdQbY0psGBPWG Q/IDktiXQYhTSZMAqHUS1SVh8KuQyx276zPr1L012sDbaYAig1X9xlVYyRFO77CX7bsW t/Xm2di6qdf1uV3bjHzK3bO5ngweXqLwJ7CAhl0xFHNNATi/ToMoWxNIFTK8GpuD9Qak AWpgCHWuW+i9l2qKyLlW5Yssv4va4jd4Io8gJbpQq016SnIQxrkIdSMiiRYp6MDfy8Fl QnPvCWDCtGrR+ybPRymuI2JcbOzdSXlALk0sus/pFjxB7kiuFjRBhG1T4i9chLVlTpE7 vFoA== 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=6qPHekHvqSoNAeTm2gklNshH1umDCg3rE3fbQqZYChw=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=RpCncXZl92LAGjThQhyKCVT5TW8WK8lNBNfFHryqtmCz9cZ2NLuotaokS2fb97Vd6P NsbEqO8ox5qgVgaOWB4LDr8L16GjgkC7u194Put9FJFuwYHRJ+YFtxwUITRaRYP67rp+ aR4BLu3F8+gTFXM8z7H1ibKAJisGwrJfKbX6Ky2bLRxwMJoR9UdjTVC0D+lggcmibPd3 brbV6wphGTdHEmtyhdefdHoDi2W2ubodIcYK0D1INNAhtOYG5jhSqDTLpcdn0C5Oi1cB Rk5zkMT/mbK+7ThI/zEc9CfwSfk0TQSZWpTDaHb/vJTXj9D/lW6arKK43gtW6/x2w0cq QkJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QfGcCY/4"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101887-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l63-20020a633e42000000b005dc0b1b0116si9260096pga.119.2024.03.13.10.18.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QfGcCY/4"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101887-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 5B94A285BBA for ; Wed, 13 Mar 2024 17:08:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00CF97BAF7; Wed, 13 Mar 2024 16:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QfGcCY/4" 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 22F2F612E6; Wed, 13 Mar 2024 16:40:22 +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=1710348023; cv=none; b=SgeatWxqDRNQZyy+0mCh1U2EYmA41AMHR0O71reRFpc82bZSt7mEkAIaHFDc2Xd77dYJxv7qnCJhO4YMvjdbXbBPV7G/isvst38MvQoYweoRmvPwlgxk2jaGNlx6oDcBcDtnV9hqRH1TRK8XN/+VO0CH6E8nNRAQyIueMyyM790= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348023; c=relaxed/simple; bh=1ayRbnay81uQwaBNVQbQadvJau2LtCm8yMXjEqr/Yic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=en0S4KCOFgpRdlL2cqTkmGZB1tsDs1XMgHBQQAKkNzX43yoXHJMGAweu2Z30nIJXlwpoLof5LmSYS3ht9ds8P50jSZ3lB9DWuxzMSOKklypxK9446ofCW/rxCyM3xWBC7YdZUdhofe/MTLzYnSt173yXzaDublYo30jVUZElLfw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QfGcCY/4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4518C43399; Wed, 13 Mar 2024 16:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348022; bh=1ayRbnay81uQwaBNVQbQadvJau2LtCm8yMXjEqr/Yic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QfGcCY/49glMJ7C8fk+8kv05Y1JmW4eZtnd4o5GMHF6scpmWHWcQ0+17ZlgArlAZo qa4ceX0AL81sxDgFPquFr7e0uYO9zOZkUzxPoMw3YhPFLTdVABCAYNhos3qYvq+9mW vw8p6eC0TaU3l9YFyJLaWecSC9P9g2uOS72QMycLYj7aE1weEUiQY6Aj2+m3YBvUm7 jWe8UJw22A0mG436Sq5YyAkcEbeyQymTAF5ajKfB/oaL5a25sjqqpPF0gXiweyFi4A ZZkro1YxsoiYNEhTMCjkX57i9tkt8X6G0xU54iHoLiX5qH0FqLiOu41+MM1eIRv4rp TrGLKfpsD+Fjg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 19/71] netrom: Fix a data-race around sysctl_netrom_default_path_quality Date: Wed, 13 Mar 2024 12:39:05 -0400 Message-ID: <20240313163957.615276-20-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 958d6145a6d9ba9e075c921aead8753fb91c9101 ] We need to protect the reader reading sysctl_netrom_default_path_quality 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/nr_route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index baea3cbd76ca5..6f709fdffc11f 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c @@ -153,7 +153,7 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic, nr_neigh->digipeat = NULL; nr_neigh->ax25 = NULL; nr_neigh->dev = dev; - nr_neigh->quality = sysctl_netrom_default_path_quality; + nr_neigh->quality = READ_ONCE(sysctl_netrom_default_path_quality); nr_neigh->locked = 0; nr_neigh->count = 0; nr_neigh->number = nr_neigh_no++; -- 2.43.0