Skip to contentSkip to conversation

xfs: fix null pointer dereference in tracepoint

PATCH New Andrey Albershteyn 1 participant 1 message Jul 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfs: fix null pointer dereference in tracepoint

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.

Cc <[email protected]> # v6.8
Fixes 3f3cec031099c3 ("xfs: force small EFIs for reaping btree extents")

---

Notes:
Add Fixes:, Cc: and RvB

 fs/xfs/libxfs/xfs_defer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_defer.c +1 -1
index c6909716b041..89501e8bd2f8 100644
@@ -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);
 }
Signature · 1 line
2.54.0