Patch "ext4: fix uninitialized variable in ext4_inlinedir_to_tree" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ext4: fix uninitialized variable in ext4_inlinedir_to_tree

to the 6.10-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-fix-uninitialized-variable-in-ext4_inlinedir_to.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 938069bddcc6d7de73703b002f19c47de12aa14b
Author: Xiaxi Shen <shenxiaxi26@xxxxxxxxx>
Date:   Tue Apr 30 20:30:17 2024 -0700

    ext4: fix uninitialized variable in ext4_inlinedir_to_tree
    
    [ Upstream commit 8dc9c3da79c84b13fdb135e2fb0a149a8175bffe ]
    
    Syzbot has found an uninit-value bug in ext4_inlinedir_to_tree
    
    This error happens because ext4_inlinedir_to_tree does not
    handle the case when ext4fs_dirhash returns an error
    
    This can be avoided by checking the return value of ext4fs_dirhash
    and propagating the error,
    similar to how it's done with ext4_htree_store_dirent
    
    Signed-off-by: Xiaxi Shen <shenxiaxi26@xxxxxxxxx>
    Reported-and-tested-by: syzbot+eaba5abe296837a640c0@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://syzkaller.appspot.com/bug?extid=eaba5abe296837a640c0
    Link: https://patch.msgid.link/20240501033017.220000-1-shenxiaxi26@xxxxxxxxx
    Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index d5bd1e3a5d36c..e7a09a99837b9 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -1410,7 +1410,11 @@ int ext4_inlinedir_to_tree(struct file *dir_file,
 			hinfo->hash = EXT4_DIRENT_HASH(de);
 			hinfo->minor_hash = EXT4_DIRENT_MINOR_HASH(de);
 		} else {
-			ext4fs_dirhash(dir, de->name, de->name_len, hinfo);
+			err = ext4fs_dirhash(dir, de->name, de->name_len, hinfo);
+			if (err) {
+				ret = err;
+				goto out;
+			}
 		}
 		if ((hinfo->hash < start_hash) ||
 		    ((hinfo->hash == start_hash) &&




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux