[PATCH v6 1/2] fs: fat: Handle 'FAT sector size mismatch'

Tom Rini trini at konsulko.com
Tue Mar 10 20:10:56 CET 2026


On Tue, 24 Feb 2026 09:19:58 +0530, Varadarajan Narayanan wrote:

> 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.
> 
> [...]

Applied to u-boot/next, thanks!

[1/2] fs: fat: Handle 'FAT sector size mismatch'
      commit: 5e7b1384902d67f4c9c405e72ae92b172e9f1974
[2/2] configs: qcom: Enable FS_FAT_HANDLE_SECTOR_SIZE_MISMATCH
      commit: 1a935da84d16716d0974be2d8802017379035a01
-- 
Tom




More information about the U-Boot mailing list