Re: [PATCH] scsi: qla2xxx avoid a panic due to BUG() if a WRITE_SAME command is sent to a device that has no protection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Laurence,

> In the current code, If a device does not have protection, qla2xx will
> land up defaulting to a BUG() and will panic the system when
> sg_write_same is sent.This is because SCSI_PROT_NORMAL is matched and
> falls through to the BUG() call. The write_same command to a device
> without protection is not handled safely.

I would like to understand why the driver PI code path was chosen for a
SCSI_PROT_NORMAL cmnd. That doesn't seem right.

> +	case SCSI_PROT_NORMAL:
> +		total_bytes = data_bytes;
> +		break;
>  	case SCSI_PROT_READ_INSERT:
>  	case SCSI_PROT_WRITE_STRIP:
>  		total_bytes = data_bytes;

All this transfer size wrangling in the driver should be removed and
replaced with a call to scsi_transfer_length() which takes the PI size
into account.

-- 
Martin K. Petersen	Oracle Linux Engineering



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux