This is a note to let you know that I've just added the patch titled ext4: initialize err_blk before calling __ext4_get_inode_loc to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ext4-initialize-err_blk-before-calling-__ext4_get_inode_loc.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c27c29c6af4f3f4ce925a2111c256733c5a5b430 Mon Sep 17 00:00:00 2001 From: Harshad Shirwadkar <harshadshirwadkar@xxxxxxxxx> Date: Wed, 1 Dec 2021 08:34:21 -0800 Subject: ext4: initialize err_blk before calling __ext4_get_inode_loc From: Harshad Shirwadkar <harshadshirwadkar@xxxxxxxxx> commit c27c29c6af4f3f4ce925a2111c256733c5a5b430 upstream. It is not guaranteed that __ext4_get_inode_loc will definitely set err_blk pointer when it returns EIO. To avoid using uninitialized variables, let's first set err_blk to 0. Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@xxxxxxxxx> Link: https://lore.kernel.org/r/20211201163421.2631661-1-harshads@xxxxxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Cc: stable@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ext4/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4371,7 +4371,7 @@ has_buffer: static int __ext4_get_inode_loc_noinmem(struct inode *inode, struct ext4_iloc *iloc) { - ext4_fsblk_t err_blk; + ext4_fsblk_t err_blk = 0; int ret; ret = __ext4_get_inode_loc(inode->i_sb, inode->i_ino, iloc, 0, @@ -4386,7 +4386,7 @@ static int __ext4_get_inode_loc_noinmem( int ext4_get_inode_loc(struct inode *inode, struct ext4_iloc *iloc) { - ext4_fsblk_t err_blk; + ext4_fsblk_t err_blk = 0; int ret; /* We have all inode data except xattrs in memory here. */ Patches currently in stable-queue which might be from harshadshirwadkar@xxxxxxxxx are queue-5.15/ext4-fix-fast-commit-may-miss-tracking-range-for-falloc_fl_zero_range.patch queue-5.15/ext4-initialize-err_blk-before-calling-__ext4_get_inode_loc.patch