Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1881063lql; Wed, 13 Mar 2024 10:38:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUUE7p5CH7YVfbClJpMZfF8AQokInt+T+ajskWmdoBIAGn/9FuurkCI+UBP78zCr6dWnFQSxBH+YivavwLJiDJ7qyg2FABzKwNqloE3Dg== X-Google-Smtp-Source: AGHT+IFO/mTbo8DVW5ekHp4Z3+pN5gdCG+5AjiaccpgYV5TS6oEjmBJNgpHyDRY90euJPA2dJTvB X-Received: by 2002:a17:902:74cb:b0:1db:de79:8664 with SMTP id f11-20020a17090274cb00b001dbde798664mr10770924plt.60.1710351518035; Wed, 13 Mar 2024 10:38:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710351518; cv=pass; d=google.com; s=arc-20160816; b=nV2BUIwZush5svpQ6aVuuu4iFlavwBXG9tr5mLW4Dbm1aWhQcHvxMapgVLS+IC4n4f iXr7Oy9qcJILymz2bbALHPsGejlaA/fA/uIirwZuJgGVdVgexAHqa02I8+OqalwX4DBF jKKdTBKWE7JtGTFqzoo0E8+bagdT9tzl5ZhZsfYjuAHEk5uXuoxVcIQ0BrU61XuxAfYp rm3OmL9IZ3KXwgRWlwCXS1C3rbDaG8ae/Jv778EqulRkDbZz45sMhn7q/YDqnRX/KmXW VC0/tZYJ9YqFtaDkE9JiPmMj4xq8eUwLUmJYvM29Iu4lWz9fNIFOvN66+6hSqf6oO+Iu t5ig== 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=f1zxKTf5h5aiA3VdrxebUnc25cn4q2oZyH9UIh+qjfQ=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=o0MiZ6y00+gazyS8gHQ3O42QPWcIxpFuvRtQWeAZvGbZJ9GKXzjqosxvIqiUetkmKp 0n8a0aRwuQ8+AfAKXrsk5gr8JYy48vrocVFbrXr40AjRs+NdDHvL/tKbRReGZZ+zG6qn 6TvGl4qNeDYUFjaJIOEMY4+l8STfqAgcWC8nwjCCpre1a2Tmt03Bbrd3kj+4jPB0TP+P FaSwQpDQL93ERTCM4A3786KYVGaXmm+KRjgD+5+oIa0fqeBr7wfpS5CVp0hSbHPR/ZVr cNRa0PhBmn5Fod0CC4Uq/yMoqbaMvzlPrJe958cP/B41mlTLDW7spE36/xo/iIswyJvF hh5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rms4OHVa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101956-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. [147.75.48.161]) by mx.google.com with ESMTPS id c17-20020a170902d49100b001dcb32068c2si4076145plg.158.2024.03.13.10.38.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rms4OHVa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101956-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 C5AA2B2288C for ; Wed, 13 Mar 2024 17:25:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07CD613B29B; Wed, 13 Mar 2024 16:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rms4OHVa" 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 2219C13AA3A; Wed, 13 Mar 2024 16:42:45 +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=1710348165; cv=none; b=n2ZJtUviQjS2Dh1tsDERcuauOcIpCB5h0cjO4DC001z88zqjX2fuCCWqNfhK3pSXqG1PUHZvePpODxwOVyAkqF8GHBokU3Kj8WrWzz6i7jteeRROSzGMTf0SJfCxDDS8zUpud3D+aKTSNR3g9/NrUcPMm5EsKqnCVPHlAugv65M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348165; c=relaxed/simple; bh=rWMYncKdMocrxg/cIRj1vKvh3WgJfF1dzGcufwTEIFg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t1yLof09aT/XbEtJ+ORY8rC6KEzr7suT5qVfTj8PFN52TArMsTmUiO2Slqipa5YtgI3EKR/81nZT/YmFGZaq8WhYRtIPEoDQCXO0wK1ZddlCSdLRNVI27pCyuwr/1eM7p0gmUd/JYhTJJdxCT4HLTK0ZH5ScZdTgQGzEh8qOThQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rms4OHVa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E02BC433C7; Wed, 13 Mar 2024 16:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348165; bh=rWMYncKdMocrxg/cIRj1vKvh3WgJfF1dzGcufwTEIFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rms4OHVakEouPbnK9qk8bySPUEdwICpNfi73j0xRQn6X06Qzu089Hf6mPptg5f1BT n50/hTlha3hxu3y3bw5d/xSdVDg1OIh+A7/bIdMSf132V/9vL2AvFJb3WBE9rFrjT1 kFeIfjQ8DGMs9GZM13D+PCwQ16Q6XW2ohUNMA5NLJCYx4e1Z3GlRCVUgsIA6BVM+N5 DDPgcV94VObMsJ3L5l65gxcPu2Vr20hrcl00cmcSv9Ip4fy6FyXQ43LyE01jyGToUz uCdJ/USV98pjBPZ7tBW2kOBUf2XLdDwY2ZLBtO8vAUab+zsm4pvN1MQsU3qziEZYIe B8KMF5FfNXrcA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 16/76] netrom: Fix a data-race around sysctl_netrom_default_path_quality Date: Wed, 13 Mar 2024 12:41:23 -0400 Message-ID: <20240313164223.615640-17-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 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 ddd5cbd455e39..55cd51977fbc2 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