]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: fix error handling in ext4_fc_record_modified_inode()
authorRitesh Harjani <riteshh@linux.ibm.com>
Mon, 17 Jan 2022 12:11:49 +0000 (17:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 17:35:19 +0000 (18:35 +0100)
commit14aa3f49c7fc6424763f4323bfbc3a807b0727dc
tree3911be903d918a7dd8712ff8a136042a45f070bb
parent627b44cf5543c13f04130083a054298f80e2a5ba
ext4: fix error handling in ext4_fc_record_modified_inode()

commit cdce59a1549190b66f8e3fe465c2b2f714b98a94 upstream.

Current code does not fully takes care of krealloc() error case, which
could lead to silent memory corruption or a kernel bug.  This patch
fixes that.

Also it cleans up some duplicated error handling logic from various
functions in fast_commit.c file.

Reported-by: luo penghao <luo.penghao@zte.com.cn>
Suggested-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/62e8b6a1cce9359682051deb736a3c0953c9d1e9.1642416995.git.riteshh@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/fast_commit.c