From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.137.202.133 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796196515; b=nymvQ4DC/TylsDx5hu0rVt1TyYX84breAlvb0/jaI87U4/xKvUCX5074zcr/Wwx0AAS7 EuEIi3kVB8Yfpq9sfjtMcXmItNaEp+iVSatq+wj2jgg69yMSiNAq6+WGkYBzwYeWAicMB vDR2Xbn3kOQxyVneL41dhcWIOmATEBbum0vaY7TZFRU3wOZmfrk1cF4i2zvL5jUtwWUrD Y2s0YUCOFPyGJF+eEInIq5i55PSoW+Jf5dhtcP2oNpqqoy9uYp8ngxZ4Xp2Dcto7zF5rq PbY+HYBmeEfWDBTJwmH58k2bT9m3JSGTkbQXR5g0FqO4KBn40yulmgiML/oQi65j7/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796196515; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:X-SRS-Rewrite; bh=8zGW2XXtUIJISqmJVIMgQRqq20/Vv188IBwIvenkAnw=; b=l+eb8AUNt4ySAgDwxAFQJSVi9oGgDF0NNeSF7yx/2Z/DWO6YzaYYN6F5A756RJDgnJAA BFim3NkHzq/rK+dFM/zQ7LND6l+1tl37C3e/PVpJTCrhJ00TlvYDV45r1XpT+VWy2OUuC aBA8DFZsIAHxZsGO5gbhGR0BmeC1vz43iorRQ5D4AQ+zih60kZh+RtfO4v4BfDtbCsH4n Bq6H8zDYC09NdJBWD1X213LXAVxfPfm+5Gptocm8mxXyRbKs8VH5H1nVwQq7wZ0WdUyTg i5tpZsZZtnmN2l0C7c9Q+Flm6kKRtIkKPlNbIQHabSq3MA6HMfpyLqbzU41BMX6MWMQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vRZmW0s8; arc=none smtp.remote-ip=198.137.202.133 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E0F4606A31A; Wed, 2 Dec 2026 07:28:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2E0F4606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vRZmW0s8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8zGW2XXtUIJISqmJVIMgQRqq20/Vv188IBwIvenkAnw=; b=vRZmW0s8ZjAdWzTEKZBBadzHIe nZJqigm70dduszuM1gS3H7hOorcnSaO+tT3H6QgbIKV6TJInVJSOqTH7YZZCaYXR6oFTQfGnyD5S1 ivjYXbnGdH3HNPoVLwgsVwFbgBalHI4SFoXZyB5sUWJQHWSj6ym87n2pgRcrV7ucTiuPUrGrpCPZP m1y3mLT/SC21bs+WG6THdqgTpJyr9IK8w6LtDNRUMayECdsxc6DbhBaKL17omPDVl2rXAJe9xKTvp vbz5SRqQS4C8E54BNR++gJb8K4sIexTHER05Zpq0rfr5CcO4cb+Q0pxc/uofNVHMVEXKMfW84eYsL jLtdnrVQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYelW-0000000AVgC-0eZy; Wed, 02 Dec 2026 07:28:34 +0000 Date: Tue, 1 Dec 2026 23:28:34 -0800 From: Christoph Hellwig To: Zheng Shuhao Cc: hch@infradead.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, cem@kernel.org, djwong@kernel.org, kees@kernel.org, syzbot+e7f24354da9f7915bc54@syzkaller.appspotmail.com, stable@vger.kernel.org Subject: Re: [PATCH v2] xfs: fix slab-use-after-free in xrep_newbt_free() Message-ID: References: <179594961807.35052.14164978078383342786@gmail.com> <179612565993.8180.4618957562824780414@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <179612565993.8180.4618957562824780414@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, Dec 01, 2026 at 07:47:39PM +0800, Zheng Shuhao wrote: > > So the condition here is not "is the file system shut down" but: > > did a defer_finish fail for this chain, and the logic needs to represent that. > > I see... Would `if (!list_empty(&sc->tp->t_dfops))` be the right check > here? Or should I add an explicit flag? That would make the change more > involved. I'll take another look. Using the control flow instead of global state is usually preferable. I.e. check which path can free the autoreap information and treat them differently using a goto or similar. I think the only relevant call is xrep_newbt_free in the xrep_newbt_free loop, but I'm not an expert on this code, so please double check.