Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: linux-xfs@vger.kernel.org, cem@kernel.org
Subject: Re: [PATCH] xfs: fix null pointer dereference in tracepoint
Date: Thu, 9 Jul 2026 07:27:09 -0700	[thread overview]
Message-ID: <20260709142709.GB15210@frogsfrogsfrogs> (raw)
In-Reply-To: <20260709094116.2025306-1-aalbersh@kernel.org>

On Thu, Jul 09, 2026 at 11:41:16AM +0200, Andrey Albershteyn wrote:
> If dfp is not NULL we exit early here, when dfp is NULL it's allocated
> in xfs_defer_alloc() but not assigned. The tracepoint tries to
> dereference members of dfp struct.
> 
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>

Heh, I have a patch just like this too!  Please add:

Cc: <stable@vger.kernel.org> # v6.8
Fixes: 3f3cec031099c3 ("xfs: force small EFIs for reaping btree extents")
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/libxfs/xfs_defer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
> index c6909716b041..89501e8bd2f8 100644
> --- a/fs/xfs/libxfs/xfs_defer.c
> +++ b/fs/xfs/libxfs/xfs_defer.c
> @@ -878,7 +878,7 @@ xfs_defer_add_barrier(
>  	if (dfp)
>  		return;
>  
> -	xfs_defer_alloc(&tp->t_dfops, &xfs_barrier_defer_type);
> +	dfp = xfs_defer_alloc(&tp->t_dfops, &xfs_barrier_defer_type);
>  
>  	trace_xfs_defer_add_item(tp->t_mountp, dfp, NULL);
>  }
> -- 
> 2.54.0
> 
> 

      reply	other threads:[~2026-07-09 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09  9:41 [PATCH] xfs: fix null pointer dereference in tracepoint Andrey Albershteyn
2026-07-09 14:27 ` 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=20260709142709.GB15210@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=cem@kernel.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