Commit 184fa50
exfat: fix out-of-bounds access of directory entries
In the case of the directory size is greater than or equal to
the cluster size, if start_clu becomes an EOF cluster(an invalid
cluster) due to file system corruption, then the directory entry
where ei->hint_femp.eidx hint is outside the directory, resulting
in an out-of-bounds access, which may cause further file system
corruption.
This commit adds a check for start_clu, if it is an invalid cluster,
the file or directory will be treated as empty.
Cc: [email protected]
Signed-off-by: Yuezhang Mo <[email protected]>
Co-developed-by: Namjae Jeon <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>1 parent 9f16d5e commit 184fa50
1 file changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
640 | 655 | | |
641 | 656 | | |
642 | 657 | | |
643 | | - | |
| 658 | + | |
644 | 659 | | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | 660 | | |
649 | 661 | | |
650 | 662 | | |
| |||
0 commit comments