]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:54:43 +0000 (13:54 +0100)
[ Upstream commit 9948dcb2f7b5a1bf8e8710eafaf6016e00be3ad6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/inode.c

index 4e2629d020b756a0b8d662b00d79dbb2940a6e08..44fbd9156a30fa429c41dfd82c31d2d0770b441e 100644 (file)
@@ -1736,6 +1736,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);