ntfs3: Fix uninit buffer allocated by __getname()
PATCH 1/1 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 [email protected]
Fixes 78ab59fee07f2 ("fs/ntfs3: Rework file operations")
Signed-off-by Sidharth Seela <[email protected]>
--
fs/ntfs3/inode.c +1 -0
@@ -1716,6 +1716,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 );
Signature · 1 line
2.47.3
Konstantin Komarov
maintainerQuoted 14 lines · Sidharth Seela
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 [email protected]Fixes 78ab59fee07f2 ("fs/ntfs3: Rework file operations")Signed-off-by Sidharth Seela <[email protected]>--
fs/ntfs3/inode.c +0
-0
fs/ntfs3/inode.c int ntfs_link_inode(struct inode *inode, struct dentry *dentry) · line 1722
Quoted 7 lines
fs/ntfs3/inode.c +1
-0@@ -1716,6 +1716,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 );
Patch looks good — applied. Thanks.
Regards,
Konstantin