ext4: fix overflows in SEEK_HOLE, SEEK_DATA implementations
authorJan Kara <jack@suse.cz>
Fri, 31 May 2013 23:37:56 +0000 (19:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jul 2013 01:21:32 +0000 (18:21 -0700)
commit80747f06d94394d0c2bc384515abe0ba460e58f4
tree4a5081790f777be5c7fcd39bc4e1652dabedb460
parente47438e6af1377ae8b29d2c0262513f54f17adcd
ext4: fix overflows in SEEK_HOLE, SEEK_DATA implementations

commit e7293fd146846e2a44d29e0477e0860c60fb856b upstream.

ext4_lblk_t is just u32 so multiplying it by blocksize can easily
overflow for files larger than 4 GB. Fix that by properly typing the
block offsets before shifting.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/file.c