From: Zheng Shuhao <viennaoffh@gmail.com>
To: hch@infradead.org
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.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: Sat, 05 Dec 2026 13:31:00 +0800 [thread overview]
Message-ID: <179644866020.268.4885883217145755379@gmail.com> (raw)
In-Reply-To: <axKAfM1uEnYL5x_n@infradead.org>
> 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.
I was told that new versions of a patch should be posted in a new thread to avoid mess. Sorry :)
> So xfs_alloc_commit_autoreap won't have any effect and we can just
> remove it entirely.
I've gone through the code carefully.It seems that removing this call in
junkit really doesn't seem to have any noticeable side effects overall...
If the filesystem is already shut down, the remaining deferred items stay
attached to the transaction until the repair unwinds and the transaction is
canceled. If an EFI was already committed without an EFD, log recovery will
handle it.
If xfs_defer_finish_noroll() fails, it cancels the paused items before
returning, so the autoreap pointer can already be stale and must not be
unpaused. If the final transaction roll fails after xfs_defer_finish_noroll()
succeeds, the paused items remain attached to the new transaction; teardown
cancels them regardless of whether they are paused. In the successful case,
the reservations have already been removed from the list before execution
falls through to junkit, so its cleanup loop has no autoreap items to unpause.
I also found another route to junkit: xrep_newbt_free_extent() can return an
error. The reservation that returned the error has already been removed from
the list; any remaining deferred items are canceled when the transaction is
torn down.
I also ran some tests after removing this call. It looks like it hasn't
introduced any obvious problems, and the results are consistent with the
baseline. I reran the ten tests that had failed in the previous run using
fresh disk overlays and a fresh log device. xfs/310 passed after enabling
CONFIG_DM_SNAPSHOT and CONFIG_DM_DELAY. The other nine failures were also
present in the baseline and list-empty results: four network-dependent generic
tests, generic/794's EOF-gap mismatch, three xfsprogs manpage-output
mismatches, and the same reproducible-image mismatch in xfs/841. There were
no unexpected writeback or no-space errors.
The focused reproducer also completed without a KASAN/use-after-free report,
and xfs_repair -n exited successfully. The trace recorded one defer-finish
error and one transaction-roll error. This was a rerun of the ten failed
tests, not a new full -g auto run.
But is it appropriate to do so? It does change the original semantics to some degree — is this the kind of change I shouldn't be the one submitting?
next prev parent reply other threads:[~2026-12-05 5:55 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
2026-12-05 5:31 ` Zheng Shuhao [this message]
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=179644866020.268.4885883217145755379@gmail.com \
--to=viennaoffh@gmail.com \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.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 \
/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