ext4: fix use-after-free race in ext4_remount()'s error path
authorTheodore Ts'o <tytso@mit.edu>
Fri, 12 Oct 2018 13:28:09 +0000 (09:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:15:06 +0000 (11:15 -0800)
commit44dcd01ee170f776fec7bd6386d08a525d713b91
treec567bdd4629ab8db81ad98f6d2ccb750a0796fd0
parentd197b725e9f0ef87ba014247211b0b900d868e04
ext4: fix use-after-free race in ext4_remount()'s error path

commit 33458eaba4dfe778a426df6a19b7aad2ff9f7eec upstream.

It's possible for ext4_show_quota_options() to try reading
s_qf_names[i] while it is being modified by ext4_remount() --- most
notably, in ext4_remount's error path when the original values of the
quota file name gets restored.

Reported-by: syzbot+a2872d6feea6918008a9@syzkaller.appspotmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org # 3.2+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/ext4.h
fs/ext4/super.c