]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ntfs3: Fix uninit buffer allocated by __getname()
authorSidharth Seela <sidharthseela@gmail.com>
Tue, 23 Sep 2025 06:40:16 +0000 (12:10 +0530)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 17 Oct 2025 14:45:38 +0000 (16:45 +0200)
Fix uninit errors caused after buffer allocation given to 'de'; by
initializing the buffer with zeroes. The fix was found by using KMSAN.

Reported-by: syzbot+332bd4e9d148f11a87dc@syzkaller.appspotmail.com
Fixes: 78ab59fee07f2 ("fs/ntfs3: Rework file operations")
Signed-off-by: Sidharth Seela <sidharthseela@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/inode.c

index b741a697e572700d32a97b70b10f57c5c5f1e48c..439078106cc6c3a9d362bb3d9ac8b4b2a1611d40 100644 (file)
@@ -1725,6 +1725,7 @@ int ntfs_link_inode(struct inode *inode, struct dentry *dentry)
        de = __getname();
        if (!de)
                return -ENOMEM;
+       memset(de, 0, PATH_MAX);
 
        /* Mark rw ntfs as dirty. It will be cleared at umount. */
        ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);