public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	Mark Tinguely <mark.tinguely@oracle.com>,
	linux-xfs@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] xfs: fix NULL ptr in xfs_attr_leaf_get
Date: Fri, 9 Jan 2026 08:21:55 -0800	[thread overview]
Message-ID: <aWErIxQxiNhTq2nR@infradead.org> (raw)
In-Reply-To: <aV32nTIWTacVXqIw@infradead.org>

On Tue, Jan 06, 2026 at 10:01:01PM -0800, Christoph Hellwig wrote:
> On Tue, Jan 06, 2026 at 07:40:26AM -0800, Darrick J. Wong wrote:
> > > > Fixes v5.8-rc4-95-g07120f1abdff ("xfs: Add xfs_has_attr and subroutines")
> > > > No reproducer.
> > > 
> > > Eww, what a mess.  I think we're better off to always leave releasing
> > > bp to the caller.  Something like the patch below.  Only compile tested
> > > for now, but I'll kick off an xfstests run.
> > > 
> > > Or maybe we might just kill off xfs_attr_leaf_hasname entirely and open
> > > code it in the three callers, which might end up being more readable?
> > 
> > ...unless this is yet another case of the block layer returning ENODATA,
> > which is then mistaken for returning ENOATTR-but-here's-your-buffer by
> > the xfs_attr code?
> 
> Not really and unless.  This patch (and the full removal that I've
> prepared in the meantime) still fix the missing buffer release in that
> case and make the code easier to follow.  But yes, they would not fix
> the underlying issue, which is why I still think we should not blindly
> propagate block layer errors into b_error.

Having looked at this a bit more, there are clear issued with the calling
convention of xfs_attr_leaf_hasname, which are fixed by removing it as 
done in the patch I just sent.

But this is very clearly another case where ENODATA/ENOATTR can leak from
the buffer cache.  So just as I said back then I think we need to stop
leaking the block status code through the buffer cache.

      reply	other threads:[~2026-01-09 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20251230190029.32684-1-mark.tinguely@oracle.com>
2025-12-30 19:02 ` [PATCH] xfs: fix NULL ptr in xfs_attr_leaf_get Mark Tinguely
2026-01-06  8:09   ` Christoph Hellwig
2026-01-06 15:40     ` Darrick J. Wong
2026-01-07  6:01       ` Christoph Hellwig
2026-01-09 16:21         ` Christoph Hellwig [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=aWErIxQxiNhTq2nR@infradead.org \
    --to=hch@infradead.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mark.tinguely@oracle.com \
    --cc=stable@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