Commit 496b9bcd authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: fix use-after-free when aborting corrupt attr inactivation



Log the corrupt buffer before we release the buffer.

Fixes: a5155b87 ("xfs: always log corruption errors")
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 3e6e8afd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -145,8 +145,8 @@ xfs_attr3_node_inactive(
	 * Since this code is recursive (gasp!) we must protect ourselves.
	 */
	if (level > XFS_DA_NODE_MAXDEPTH) {
		xfs_trans_brelse(*trans, bp);	/* no locks for later trans */
		xfs_buf_corruption_error(bp);
		xfs_trans_brelse(*trans, bp);	/* no locks for later trans */
		return -EFSCORRUPTED;
	}