]> git.karo-electronics.de Git - linux-beck.git/commit
xfs: don't allow di_size with high bit set
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 5 Dec 2016 01:38:38 +0000 (12:38 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 5 Dec 2016 01:38:38 +0000 (12:38 +1100)
commitef388e2054feedaeb05399ed654bdb06f385d294
tree50b1ba9f23aa82d4d8299fb35b1d4b72df316c7e
parent0f352f8ee8412bd9d34fb2a6411241da61175c0e
xfs: don't allow di_size with high bit set

The on-disk field di_size is used to set i_size, which is a signed
integer of loff_t.  If the high bit of di_size is set, we'll end up with
a negative i_size, which will cause all sorts of problems.  Since the
VFS won't let us create a file with such length, we should catch them
here in the verifier too.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_inode_buf.c