Skip to content

Commit 02dffe9

Browse files
committed
exfat: fix uninit-value in __exfat_get_dentry_set
There is no check if stream size and start_clu are invalid. If start_clu is EOF cluster and stream size is 4096, It will cause uninit value access. because ei->hint_femp.eidx could be 128(if cluster size is 4K) and wrong hint will allocate next cluster. and this cluster will be same with the cluster that is allocated by exfat_extend_valid_size(). The previous patch will check invalid start_clu, but for clarity, initialize hint_femp.eidx to zero. Cc: stable@vger.kernel.org Reported-by: syzbot+01218003be74b5e1213a@syzkaller.appspotmail.com Tested-by: syzbot+01218003be74b5e1213a@syzkaller.appspotmail.com Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent 184fa50 commit 02dffe9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/exfat/namei.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ static int exfat_find_empty_entry(struct inode *inode,
345345
if (ei->start_clu == EXFAT_EOF_CLUSTER) {
346346
ei->start_clu = clu.dir;
347347
p_dir->dir = clu.dir;
348+
hint_femp.eidx = 0;
348349
}
349350

350351
/* append to the FAT chain */

0 commit comments

Comments
 (0)