]> 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, 9 Jan 2017 15:38:56 +0000 (16:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:39:43 +0000 (11:39 +0100)
commitf8b20705a383357ddca04ea648a7ac8fccd438ef
tree7a6df3b6f9ed6daeb677e238120d4bb6f714db70
parent12815dd15c480c0d595401e4eec54542025607f6
xfs: don't allow di_size with high bit set

commit ef388e2054feedaeb05399ed654bdb06f385d294 upstream.

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>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_inode_buf.c