ext4: fix overflow caused by missing cast in ext4_resize_fs()
authorJerry Lee <jerrylee@qnap.com>
Sun, 6 Aug 2017 05:18:31 +0000 (01:18 -0400)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:18:11 +0000 (13:18 +0000)
commit60d0c1b073dccde987288f398d71a95ac933f5b2
treebb767d87c0a830f769b1018a3e77a4e113b8b768
parentf4126974b644d8749ea0e5320e13ca34090b5927
ext4: fix overflow caused by missing cast in ext4_resize_fs()

commit aec51758ce10a9c847a62a48a168f8c804c6e053 upstream.

On a 32-bit platform, the value of n_blcoks_count may be wrong during
the file system is resized to size larger than 2^32 blocks.  This may
caused the superblock being corrupted with zero blocks count.

Fixes: 1c6bd7173d66
Signed-off-by: Jerry Lee <jerrylee@qnap.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org # 3.7+
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/ext4/resize.c