]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: fix fencepost error in check for inode count overflow during resize
authorJan Kara <jack@suse.cz>
Fri, 25 May 2018 16:51:25 +0000 (12:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:18:43 +0000 (11:18 +0200)
commit8295fb01602c042dfe892e7bdc28b04ba84f9b90
treee5662fea84f714215d4d7f06f5649b3d808f8b5a
parentf7eb9c228bda60f5ec48706fa64526fa34a034e7
ext4: fix fencepost error in check for inode count overflow during resize

commit 4f2f76f751433908364ccff82f437a57d0e6e9b7 upstream.

ext4_resize_fs() has an off-by-one bug when checking whether growing of
a filesystem will not overflow inode count. As a result it allows a
filesystem with 8192 inodes per group to grow to 64TB which overflows
inode count to 0 and makes filesystem unusable. Fix it.

Cc: stable@vger.kernel.org
Fixes: 3f8a6411fbada1fa482276591e037f3b1adcf55b
Reported-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/resize.c