]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: detect overflows in bmbt records
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 7 Jan 2021 20:59:17 +0000 (15:59 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 7 Jan 2021 20:59:17 +0000 (15:59 -0500)
commit92415d01728c022f13f1fc102957c6477f660a8c
tree24eca13b33bda66a92a039cec1b3be584e609069
parentfa9712a0d28909a5400f96394d46633978199020
xfs: detect overflows in bmbt records

Source kernel commit: acf104c2331c1ba2a667e65dd36139d1555b1432

Detect file block mappings with a blockcount that's either so large that
integer overflows occur or are zero, because neither are valid in the
filesystem.  Worse yet, attempting directory modifications causes the
iext code to trip over the bmbt key handling and takes the filesystem
down.  We can fix most of this by preventing the bad metadata from
entering the incore structures in the first place.

Found by setting blockcount=0 in a directory data fork mapping and
watching the fireworks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c