From: Guo Xuenan guoxuenan@huawei.com
Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I76JSK
--------------------------------
This reverts commit 1768d0fc0015c38aaa6c0e609405a17d49a3f2a8.
Signed-off-by: Guo Xuenan guoxuenan@huawei.com Signed-off-by: Long Li leo.lilong@huawei.com --- fs/xfs/libxfs/xfs_dir2_leaf.c | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c index 69f37dcbdc12..4abf24c3aa94 100644 --- a/fs/xfs/libxfs/xfs_dir2_leaf.c +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c @@ -815,18 +815,6 @@ xfs_dir2_leaf_addname( */ else xfs_dir3_leaf_log_bests(args, lbp, use_block, use_block); - /* - * An abnormal corner case, bestfree count less than data - * blocks, add a condition to avoid UAF or slab-out-of bound. - */ - if ((char *)(&bestsp[use_block]) >= (char *)ltp) { - xfs_trans_brelse(tp, lbp); - if (tp->t_flags & XFS_TRANS_DIRTY) - xfs_force_shutdown(tp->t_mountp, - SHUTDOWN_CORRUPT_INCORE); - return -EFSCORRUPTED; - } - hdr = dbp->b_addr; bf = xfs_dir2_data_bestfree_p(dp->i_mount, hdr); bestsp[use_block] = bf[0].length;