Unverified Commit 9948dcb2 authored by Sidharth Seela's avatar Sidharth Seela Committed by Konstantin Komarov
Browse files

ntfs3: Fix uninit buffer allocated by __getname()



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: default avatar <syzbot+332bd4e9d148f11a87dc@syzkaller.appspotmail.com>
Fixes: 78ab59fe ("fs/ntfs3: Rework file operations")
Signed-off-by: default avatarSidharth Seela <sidharthseela@gmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent 73e6b9da
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);