summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2022-09-24 18:26:56 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-28 11:04:11 +0200
commit26e7c965f41bd34e069c3c113fa5b297d972c30b (patch)
treec4bb892a367c4e0fd28c9efbb2fb82ba8e3ef79c
parent8b3c9eb1b3dd8f0f6d45224964f42cff99eaac61 (diff)
xfs: fix use-after-free when aborting corrupt attr inactivation
commit 496b9bcd62b0b3a160be61e3265a086f97adcbd3 upstream. Log the corrupt buffer before we release the buffer. Fixes: a5155b870d687 ("xfs: always log corruption errors") Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/xfs/xfs_attr_inactive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index 43ae392992e7..766b1386402a 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -209,8 +209,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;
}