Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1849237lql; Wed, 13 Mar 2024 09:45:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVK7EBzcSXxVMft9eJCB7oWflcLMrJ43xOmbXshatMdSAsWIjhSsiwQZSXWaoDdBCl5sE8p4kgxseeHZOP4DydAh8QRyvXxI8npq7IQA== X-Google-Smtp-Source: AGHT+IH9cj7SWNQhcdR0lLQXPEa+cQDpRoAOLp8LVRZFoiTcKctAPZ24eZGIut+yqWoNhotk42ed X-Received: by 2002:a17:902:c1c4:b0:1db:d811:732a with SMTP id c4-20020a170902c1c400b001dbd811732amr5176175plc.37.1710348334545; Wed, 13 Mar 2024 09:45:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348334; cv=pass; d=google.com; s=arc-20160816; b=Gh5l8eH0jSio/gW0356eyqKZYfDqghUX4uLu+2DddUdGvl6Ij+v6AKC6ia/30lWypo FJ833bCwsn9SbZRjpMAN+XoZw+F4LDv3olEsWk41pPfHURJN1ig9tsiLQrD7R4Reohho 3lkqFK5vzFuAxYnyqG6ybaC+zYTG/DX9KUTeS4sVP1XT0rg/Y10fd0GvCATqvvQehoSp IZuWQn27dP/piMr2TvXest4am+k/s/+cpvLOGbIrkVfZiG6mPVMazVAtZRR2P0Thcgxr SmFC3tL70VNxbLNAKxEMXnKZ8Axhc/7W0quYw+eCI42XMdXbMXKQzrG2JRcnlKckFsB3 1z8w== 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=vZBSL7ZmFz45Wf/uefh5XzzqHmEUEiesCcN3W7uQh1Tf6/iXGcuiNiTf2/qJAxv/r3 vqlcgzZZ1w6n4FFtOLjag1pkMTJwP1zJ6RkLcKJK0vm7DAsv3ppSsJRF4Rdnqvil1ZfP jiH0v5PDV/Nn5CkeUZ0Y8SREF25PhF51niUQtu4i8OunI+AkhGUlficuj9tJgGI+PN32 2nN7ec+DtGk5wX24hHQC3XAJ4EUAx5CEkgY0xyXZkNLQ6VhvX7dJuWRWcaTG4qs4V2CM kcPCaUGng6h8YaBMV6iv9E+0ieAxSfd/3asdPDevnXhY6aJJec+hJnhM3FrPSb6DfB4g fUfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LdaXyNFd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101782-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101782-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 lm5-20020a170903298500b001dd04d57a22si9584799plb.67.2024.03.13.09.45.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:45:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101782-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=LdaXyNFd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101782-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101782-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 EA650B219D0 for ; Wed, 13 Mar 2024 16:42:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDFD762A1C; Wed, 13 Mar 2024 16:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LdaXyNFd" 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 0CA9262A00; Wed, 13 Mar 2024 16:33:31 +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=1710347611; cv=none; b=mP0datuylvY172RjNiZPKG4fLjBsE8fvJ5sFTl52YEtx7NEQa8qeKtn/QvP9Wkh56Z6gLuBcDNBsLoXGCz2wHi6Ai3qyVoyyeV19WNHZgki9y8ZHvezo0XcLQubCIJ+0XdRndEDqr+vcwKs44QkXBcZCphztFl7SWBEHL1DDmPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347611; c=relaxed/simple; bh=1ayRbnay81uQwaBNVQbQadvJau2LtCm8yMXjEqr/Yic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZWfGrKiVoUqKAk4wHWiDQ8R/lcuqLyAVF/fSmAuFv4ZIYl3aHACswMZ0NkAqNscfUKvpGJjFpygCObtv9dPd4TWhwz+bNW5wQeJFnvZnpoP5960Nbf9/pH6DKbXTmhRYpdoexyivY0mMchwggyIaVAHcZZYvTaBxZbImq1sUwRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LdaXyNFd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33207C433C7; Wed, 13 Mar 2024 16:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347610; bh=1ayRbnay81uQwaBNVQbQadvJau2LtCm8yMXjEqr/Yic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LdaXyNFdNNEKcGbboNwJT5gc+/iMnIMB88zdN1rlQaLFZlGwD9ckqakEPpgpas1KM piGBC0OmpAGNGpJWPVjRAgU0JarrmmAHByu8pwQXIHRDxz7VNi68hfAcf0z6bpiVlf qP76Janv32XxCePVet8bffiQ1/J0a5KeFKMmxE/uhAWJ9XAc1fXk+7hzl3RI3uydyA cBrRYZ5OFt/2nn4S/Lty5c6OYo7mnJFlwqEi2K3c+IMW8uJ2jXyjyclJ6+vdUUkGMx KcQI/IhSZTUFcPo93guJCkbcnP6D5QAMpm7+Km5DSB8A77Fe0CHBVrimoC4Bc5wGHz C8pkc6iXxXknQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.7 43/61] netrom: Fix a data-race around sysctl_netrom_default_path_quality Date: Wed, 13 Mar 2024 12:32:18 -0400 Message-ID: <20240313163236.613880-44-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 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