Re: [PATCH] scsi: sg: only check for dxfer_len greater than 256M

From: Hannes Reinecke
Date: Thu Jul 27 2017 - 04:43:23 EST


On 07/27/2017 09:11 AM, Johannes Thumshirn wrote:
> Don't make any assumptions on the sg_io_hdr_t::dxfer_direction or the
> sg_io_hdr_t::dxferp in order to determine if it is a valid request. The
> only way we can check for bad requests is by checking if the length exceeds
> 256M.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@xxxxxxx>
> Fixes: 28676d869bbb (scsi: sg: check for valid direction before starting the
> request)
> Reported-by: Jason L Tibbitts III <tibbs@xxxxxxxxxxx>
> Tested-by: Jason L Tibbitts III <tibbs@xxxxxxxxxxx>
> Suggested-by: Doug Gilbert <dgilbert@xxxxxxxxxxxx>
> Cc: Doug Gilbert <dgilbert@xxxxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>
> ---
> drivers/scsi/sg.c | 31 +------------------------------
> 1 file changed, 1 insertion(+), 30 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@xxxxxxxx>

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@xxxxxxx +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 NÃrnberg
GF: F. ImendÃrffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG NÃrnberg)