[PATCH v1] scsi: ufs: scsi_get_lba error fix by check cmd opcode

Bart Van Assche bvanassche at acm.org
Tue Mar 8 14:11:39 PST 2022


On 3/7/22 03:17, peter.wang at mediatek.com wrote:
> When ufs init without scmd->device->sector_size set,
> scsi_get_lba will get a wrong shift number and ubsan error.
> shift exponent 4294967286 is too large for 64-bit type
> 'sector_t' (aka 'unsigned long long')
> Call scsi_get_lba only when opcode is READ_10/WRITE_10/UNMAP.

Reviewed-by: Bart Van Assche <bvanassche at acm.org>



More information about the Linux-mediatek mailing list