Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Zheng Shuhao <viennaoffh@gmail.com>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	hch@infradead.org, cem@kernel.org, djwong@kernel.org,
	hemanth.selam@gmail.com, shinsj4653@gmail.com,
	syzbot+e7f24354da9f7915bc54@syzkaller.appspotmail.com
Subject: Re: [PATCH v3] xfs: fix slab-use-after-free in xrep_newbt_free()
Date: Fri, 4 Dec 2026 00:57:32 -0800	[thread overview]
Message-ID: <axKAfM1uEnYL5x_n@infradead.org> (raw)
In-Reply-To: <179630412330.565.9260762935217160800@gmail.com>

The email format is a bit odd.  It obviously is a reply continuing
the previous discussion, but it breaks threading and adds a new subject.

On Thu, Dec 03, 2026 at 09:22:03PM +0800, Zheng Shuhao wrote:
> On Wed, Dec 2, 2026 at 07:28:34AM +0000, Christoph Hellwig wrote:
> > 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.
> 
> I considered changing the control flow, but found that this would make
> error-path handling more complex because the defer-finish failure paths
> would need to be handled separately.
> 
> I therefore kept the existing control flow and used a standard list
> traversal to check whether the exact deferred item is still pending
> before unpausing it.

This now pokes into defer_ops implementation details.  I spent some
time looking at this, but AFAICS the call to xfs_alloc_commit_autoreap
in xrep_newbt_free is always superfluous.  The only way we can end up
in that error path is with a file system either already shut down,
or about to shut down due to corruption.

So xfs_alloc_commit_autoreap won't have any effect and we can just
remove it entirely.


  reply	other threads:[~2026-12-04  8:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 13:22 [PATCH v3] xfs: fix slab-use-after-free in xrep_newbt_free() Zheng Shuhao
2026-12-04  8:57 ` Christoph Hellwig [this message]
2026-12-05  5:31   ` Zheng Shuhao
2026-12-05  7:03     ` Carlos Maiolino
2026-12-05 12:58       ` Zheng Shuhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axKAfM1uEnYL5x_n@infradead.org \
    --to=hch@infradead.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hemanth.selam@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=shinsj4653@gmail.com \
    --cc=syzbot+e7f24354da9f7915bc54@syzkaller.appspotmail.com \
    --cc=viennaoffh@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox