ext4: fix use-after-free race with debug_want_extra_isize
authorBarret Rhoden <brho@google.com>
Thu, 25 Apr 2019 15:55:50 +0000 (11:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 05:37:42 +0000 (07:37 +0200)
commit2a18c9c76718f77a08177f1fc20007fab2fdafdd
treeed333c90c5e4dd789a09bfb1c0f5f52a9e4c644b
parentb12a8d80a46e8ab02eb9124a36562a93bbd7224b
ext4: fix use-after-free race with debug_want_extra_isize

commit 7bc04c5c2cc467c5b40f2b03ba08da174a0d5fa7 upstream.

When remounting with debug_want_extra_isize, we were not performing the
same checks that we do during a normal mount.  That allowed us to set a
value for s_want_extra_isize that reached outside the s_inode_size.

Fixes: e2b911c53584 ("ext4: clean up feature test macros with predicate functions")
Reported-by: syzbot+f584efa0ac7213c226b7@syzkaller.appspotmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Barret Rhoden <brho@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/super.c