diff options
| author | Varadarajan Narayanan <[email protected]> | 2026-02-24 09:19:59 +0530 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-03-10 11:52:14 -0600 |
| commit | 5e7b1384902d67f4c9c405e72ae92b172e9f1974 (patch) | |
| tree | b94c1ef348b735a40c9b2ac140e854ec5223eec7 /scripts/checkpatch.pl | |
| parent | c61d6f67f46f05149182b33c3c0ba5d9b6b46889 (diff) | |
fs: fat: Handle 'FAT sector size mismatch'
The disk_read() and disk_write() functions of the FAT driver use the
blk_dread() and blk_dwrite() respectively. The blk_* APIs read and write
to the devices in terms of the device block size. However, the FAT
driver reads in terms of the device block size (from fat_set_blk_dev and
read_bootsectandvi) and sector size in the rest of the places.
This causes buffer overflows or partial reads when the FAT sector size
is not equal to device block size. Fix this by using blk_dread in
fat_set_blk_dev and read_bootsectandvi instead of disk_read. And update
disk_read/disk_write to handle FAT sector size and block size mismatch.
Tested on
blksz | FAT sector size
------+----------------
4096 | 4096
512 | 512
4096 | 512
512 | 4096
Signed-off-by: Varadarajan Narayanan <[email protected]>
Diffstat (limited to 'scripts/checkpatch.pl')
0 files changed, 0 insertions, 0 deletions
