public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Carlos Maiolino <cem@kernel.org>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: fix a UAF problem in xattr repair
Date: Fri, 5 Dec 2025 09:12:13 -0800	[thread overview]
Message-ID: <20251205171213.GR89472@frogsfrogsfrogs> (raw)
In-Reply-To: <aTKSWb-wR7pQ43Mk@infradead.org>

On Fri, Dec 05, 2025 at 12:05:45AM -0800, Christoph Hellwig wrote:
> On Thu, Dec 04, 2025 at 01:43:50PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > The xchk_setup_xattr_buf function can allocate a new value buffer, which
> > means that any reference to ab->value before the call could become a
> > dangling pointer.  Fix this by moving an assignment to after the buffer
> > setup.
> 
> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> Do you have a test case for this?

Not yet, but working on it.  I'm working on a corruption problem I
occasionally see in the xattr leaf freemap code, so I think the trick is
that you have to generate a leaf block with a corruption that will cause
the scrubber to exit early having called xchk_*_set_corrupt, and then a
remote xattr with a value larger than xfs_attr_leaf_entsize_local_max.

Obviously this is easy to reproduce after I added a verifier check for
corrupt freemap data, but for older kernels I'd need to inject some
sort of corruption.  Probably twiddling the crc or something would
suffice, but ATM I'm a little absorbed in sorting out the freemap code
and stamping out the bugs.

--D

      reply	other threads:[~2025-12-05 17:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 21:43 [PATCH] xfs: fix a UAF problem in xattr repair Darrick J. Wong
2025-12-05  8:05 ` Christoph Hellwig
2025-12-05 17:12   ` Darrick J. Wong [this message]

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=20251205171213.GR89472@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    /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