projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6958d11
)
xfs: dabtree scrub needs to range-check level
author
Darrick J. Wong
<darrick.wong@oracle.com>
Tue, 19 Mar 2019 15:16:21 +0000
(08:16 -0700)
committer
Darrick J. Wong
<darrick.wong@oracle.com>
Tue, 19 Mar 2019 15:16:21 +0000
(08:16 -0700)
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>
fs/xfs/scrub/dabtree.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/xfs/scrub/dabtree.c
b/fs/xfs/scrub/dabtree.c
index f1260b4bfdeed62440cc238138e7fd405c2dccf1..90527b094878971f831c78daafe2483dd99e83d2 100644
(file)
--- 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)