]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - repair/dinode.c
xfs_repair: validate on-disk extent count better
authorDave Chinner <dchinner@redhat.com>
Thu, 2 May 2013 12:59:20 +0000 (07:59 -0500)
committerRich Johnston <rjohnston@sgi.com>
Thu, 2 May 2013 13:04:54 +0000 (08:04 -0500)
commit5fa285318bf8133041aab508a765c81a85174c65
tree2787c316aef8735236443a0539db227e37bcc5bb
parent30626ef667746c51a6b93e21fc95eb5607c0002a
xfs_repair: validate on-disk extent count better

When scanning a btree format inode, we trust the extent count to be
in range.  However, values of the range 2^31 <= cnt < 2^32 are
invalid and can cause problems with signed range checks. This
results in assert failures which validating the extent count such
as:

xfs_repair: dinode.c:768: process_bmbt_reclist_int: Assertion `i < *numrecs' failed.

Validate the extent count is at least within the positive range of a
signed 32 bit integer before using it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
repair/dinode.c