From mboxrd@z Thu Jan 1 00:00:00 1970 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 904F279C4; Wed, 23 Oct 2024 15:57:21 +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=1729699041; cv=none; b=cJjf9Cz/rqw9qPmDmSuFxo7AcGHCfCqn9vtceU/8mdWsDLsgYYpdx4UssMvq4BTIT5b1TEdGvqk6/AUFjh3EnKzy9BlVBgi8fTzRnidGAvhA4EkC/aliKdPU2xZsZxbG07g7TxKy8oMNZ0pWVAnGiVdjEz6PlLTK8dsiqFRt3ks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729699041; c=relaxed/simple; bh=9f+SvZb+fL91MnsgYWBmBdE4SJwezL8Zc+dk0NsZUDo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MR9Vsgm3wfi56P+6oCVNC+iyVZZUETCgujbma5EA0Fpa0TNzrMO7rdBYZTQuePdn4zGqLPMAJAt06QRALFZfdPYMyaoV1D52qH9YrCJWA+6CrGWjZQLTRSdI9p/rzv67cxm6WIfBkOww4z3vcqcIZdnXzUrGO7t2wdkGqjmCOTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pYF1naHs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pYF1naHs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E74CEC4CEC6; Wed, 23 Oct 2024 15:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729699041; bh=9f+SvZb+fL91MnsgYWBmBdE4SJwezL8Zc+dk0NsZUDo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pYF1naHsVf6ILIbEuHsIV4EYdTrjJaa3gW0vLjNwBbt0W88rNtjtZPBuHrUcnmMQD L+OEHYQWCy8bWGTnUu/jqaREf/mZROg3Dm86TeJn7JE/7yENW6ed9ysZRgCMtVDc0z iLj1TkpqWtky8Bhu2vMbRIX3R+iB0orbkxwe9o1pFM64BYggIieDwgxjHtA7v5bO7F GmUP7gOZRbkHWzeI0b5YnGIXsavEqTJm26kLPVdNRbs0fcIQa9PnpxHk+KPVU1JiDF 8072IKpLCrGVl+MnbGhWxK3nuIhRLGj+l6iNp84pHY0j9CBTj3YpRMslIwZJY7Kxek 26hZImZc57f6g== Date: Wed, 23 Oct 2024 11:57:18 -0400 From: Sasha Levin To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.4 7/7] lib/generic-radix-tree.c: Fix rare race in __genradix_ptr_alloc() Message-ID: References: <20241012112948.1764454-1-sashal@kernel.org> <20241012112948.1764454-7-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: On Sat, Oct 12, 2024 at 02:54:01PM -0400, Kent Overstreet wrote: >On Sat, Oct 12, 2024 at 07:29:42AM GMT, Sasha Levin wrote: >> From: Kent Overstreet >> >> [ Upstream commit b2f11c6f3e1fc60742673b8675c95b78447f3dae ] >> >> If we need to increase the tree depth, allocate a new node, and then >> race with another thread that increased the tree depth before us, we'll >> still have a preallocated node that might be used later. >> >> If we then use that node for a new non-root node, it'll still have a >> pointer to the old root instead of being zeroed - fix this by zeroing it >> in the cmpxchg failure path. >> >> Signed-off-by: Kent Overstreet >> Signed-off-by: Sasha Levin > >there wasn't any need to backport this, bcachefs is the only thing that >uses genradix in multithreaded mode Will do, thanks! -- Thanks, Sasha