Re: [syzbot] [hfs?] KMSAN: uninit-value in hfs_iget

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

 



When the read data is insufficient to fill the rec, use 0 to fill it

#syz test

diff --git a/fs/hfs/bfind.c b/fs/hfs/bfind.c
index ef9498a6e88a..f0292b76e3d4 100644
--- a/fs/hfs/bfind.c
+++ b/fs/hfs/bfind.c
@@ -168,6 +168,8 @@ int hfs_brec_read(struct hfs_find_data *fd, void *rec, int rec_len)
 	if (fd->entrylength > rec_len)
 		return -EINVAL;
 	hfs_bnode_read(fd->bnode, rec, fd->entryoffset, fd->entrylength);
+	if (rec_len > fd->entrylength)
+		memset(rec + fd->entrylength, 0, rec_len - fd->entrylength);
 	return 0;
 }
 





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux