summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-03-19 08:16:21 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-03-19 08:16:21 -0700
commit228de124f290e6b981b2c61fbd78215e11264044 (patch)
treeab60a57d0238ccba12d3186c58a47734217495fe /fs
parent6958d11f77d45db80f7e22a21a74d4d5f44dc667 (diff)
downloadlinux-228de124f290e6b981b2c61fbd78215e11264044.tar.bz2
xfs: dabtree scrub needs to range-check level
Make sure scrub's dabtree iterator function checks that we're not going deeper in the stack than our cursor permits. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/scrub/dabtree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
index f1260b4bfdee..90527b094878 100644
--- a/fs/xfs/scrub/dabtree.c
+++ b/fs/xfs/scrub/dabtree.c
@@ -574,6 +574,11 @@ xchk_da_btree(
/* Drill another level deeper. */
blkno = be32_to_cpu(key->before);
level++;
+ if (level >= XFS_DA_NODE_MAXDEPTH) {
+ /* Too deep! */
+ xchk_da_set_corrupt(&ds, level - 1);
+ break;
+ }
ds.tree_level--;
error = xchk_da_btree_block(&ds, level, blkno);
if (error)