]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ext4: don't try to processed freed blocks until mballoc is initialized
authorTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jan 2021 17:33:20 +0000 (12:33 -0500)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 17 Mar 2021 18:39:53 +0000 (13:39 -0500)
commit475af045ddd8eb0a847988d4add2528534155174
tree14c3bcea11d53f077ca722b8c0c87ffa8d300489
parentce1f578ba443f4d8ba141b486a9b1091be0e269c
ext4: don't try to processed freed blocks until mballoc is initialized

BugLink: https://bugs.launchpad.net/bugs/1919492
[ Upstream commit 027f14f5357279655c3ebc6d14daff8368d4f53f ]

If we try to make any changes via the journal between when the journal
is initialized, but before the multi-block allocated is initialized,
we will end up deferencing a NULL pointer when the journal commit
callback function calls ext4_process_freed_data().

The proximate cause of this failure was commit 2d01ddc86606 ("ext4:
save error info to sb through journal if available") since file system
corruption problems detected before the call to ext4_mb_init() would
result in a journal commit before we aborted the mount of the file
system.... and we would then trigger the NULL pointer deref.

Link: https://lore.kernel.org/r/YAm8qH/0oo2ofSMR@mit.edu
Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/ext4/super.c