diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-03-11 18:37:53 +0100 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-03-12 15:58:11 +0100 |
commit | 496b9bcd62b0b3a160be61e3265a086f97adcbd3 (patch) | |
tree | 2895ebba43ecbe674794083ec586b7c34bcd1513 /fs/xfs/xfs_attr_inactive.c | |
parent | xfs: remove XFS_BUF_TO_SBP (diff) | |
download | linux-496b9bcd62b0b3a160be61e3265a086f97adcbd3.tar.xz linux-496b9bcd62b0b3a160be61e3265a086f97adcbd3.zip |
xfs: fix use-after-free when aborting corrupt attr inactivation
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>
Diffstat (limited to 'fs/xfs/xfs_attr_inactive.c')
-rw-r--r-- | fs/xfs/xfs_attr_inactive.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c index bbfa6ba84dcd..fe8f60b59ec4 100644 --- a/fs/xfs/xfs_attr_inactive.c +++ b/fs/xfs/xfs_attr_inactive.c @@ -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; } |