Skip to content

Commit

Permalink
exfat: fix uninit-value in __exfat_get_dentry_set
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
namjaejeon committed Oct 27, 2024
1 parent 7c938a7 commit 7489378
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ static int exfat_find_empty_entry(struct inode *inode,
if (ei->start_clu == EXFAT_EOF_CLUSTER) {
ei->start_clu = clu.dir;
p_dir->dir = clu.dir;
hint_femp.eidx = 0;
}

/* append to the FAT chain */
Expand Down

0 comments on commit 7489378

Please sign in to comment.