Re: [PATCH v1] exfat: fix exfat_find_empty_entry() not returning error on failure

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

 



>> Fixes: 8a3f5711ad74 ("exfat: reduce FAT chain traversal")
> This issue caused by this patch ? If yes, Could you elaborate how this
patch make this issue ?

Yes.

This issue caused by the change in this patch.

-       return dentry;
+       p_dir->dir = exfat_sector_to_cluster(sbi, es->bh[0]->b_blocknr);
+       p_dir->size -= dentry / sbi->dentries_per_clu;
+
+       return dentry & (sbi->dentries_per_clu - 1);
 }

'dentry' is -EIO or -ENOMEM when reading directory entries fails.

"dentry & (sbi->dentries_per_clu - 1)" makes the return value a positive value,
so that exfat_add_entry() always thinks that the directory entry is read successfully.

> I can not reproduce it using C-reproducer. Have you reproduced it ?

This issue occurs when reading directory entries fails(this can be confirmed by
https://syzkaller.appspot.com/text?tag=Patch&x=1068bd30580000). 
Reproducing it requires a disk with bad blocks, I can not reproduce it too.




[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