path: root/drivers/scsi/sd.c
diff options
authorMikulas Patocka <>2020-01-15 08:35:25 -0500
committerJens Axboe <>2020-01-15 21:43:09 -0700
commitad6bf88a6c19a39fb3b0045d78ea880325dfcf15 (patch)
treef205d6e5e7679bad32bc676242018db08444d1ac /drivers/scsi/sd.c
parent16c731fed6d8e5615e23d2fd59cfe62eb10d9ff4 (diff)
block: fix an integer overflow in logical block size
Logical block size has type unsigned short. That means that it can be at most 32768. However, there are architectures that can run with 64k pages (for example arm64) and on these architectures, it may be possible to create block devices with 64k block size. For exmaple (run this on an architecture with 64k pages): Mount will fail with this error because it tries to read the superblock using 2-sector access: device-mapper: writecache: I/O is not aligned, sector 2, size 1024, block size 65536 EXT4-fs (dm-0): unable to read superblock This patch changes the logical block size from unsigned short to unsigned int to avoid the overflow. Cc: Reviewed-by: Martin K. Petersen <> Reviewed-by: Ming Lei <> Signed-off-by: Mikulas Patocka <> Signed-off-by: Jens Axboe <>
Diffstat (limited to 'drivers/scsi/sd.c')
0 files changed, 0 insertions, 0 deletions