]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: fix null pointer dereference in tracepoint
authorAndrey Albershteyn <aalbersh@kernel.org>
Thu, 9 Jul 2026 15:24:07 +0000 (17:24 +0200)
committerCarlos Maiolino <cem@kernel.org>
Sun, 12 Jul 2026 15:32:27 +0000 (17:32 +0200)
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>
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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_defer.c

index c6909716b041518ad91437d89e7a7adb7a0194a1..89501e8bd2f8458c25b6c69b8474ba7eda12c0dc 100644 (file)
@@ -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);
 }