]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: validate btree block magic in the freesp command
authorPeter Watkins <treestem@gmail.com>
Fri, 9 Jul 2010 16:17:10 +0000 (09:17 -0700)
committerChristoph Hellwig <hch@lst.de>
Fri, 9 Jul 2010 16:17:10 +0000 (09:17 -0700)
commit65b04d8cf71ee5ddd8d7bf50535159206f7e233e
tree2f3985edbc15f7f4ea949cf16d3a06e8a03764c2
parent527d1f4265ec357909fa494181e4aefae7be0b37
xfs_db: validate btree block magic in the freesp command

Occasionally I've hit a SEGV while querying free space in xfs_db on a
mounted file system. In scanfunc_bno, block->bb_numrecs has crazy values.
And bb_magic is not XFS_ABTB_MAGIC.

Check for the correct magic number first, and return otherwise.

Signed-off-by: Peter Watkins <treestem@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
db/freesp.c