]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerJiri Slaby <jslaby@suse.cz>
Fri, 7 Apr 2017 07:17:43 +0000 (09:17 +0200)
commitffd0475d31d0561b4d913fd6b84d5a70e56a8a49
tree48a6c84fb854f2ed12df8d336b1464d856d842b2
parent35c9f7f27b0765fb2713a41d5d60d144e983221e
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.

[nborisov: Backported to 3.12]

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>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/xfs/xfs_inode_buf.c