Re: [PATCH 15/16] block: split scsi_request out of struct request

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

 



On Mon, 2017-01-23 at 16:29 +0100, Christoph Hellwig wrote:
> @@ -251,11 +251,13 @@ static int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
>          * is invalid.  Prevent the garbage from being misinterpreted
>          * and prevent security leaks by zeroing out the excess data.
>          */
> -       if (unlikely(req->resid_len > 0 && req->resid_len <= bufflen))
> -               memset(buffer + (bufflen - req->resid_len), 0, req->resid_len);
> +       if (unlikely(rq->resid_len > 0 && rq->resid_len <= bufflen))
> +               memset(buffer + (bufflen - rq->resid_len), 0, rq->resid_len);
>  
>         if (resid)
> -               *resid = req->resid_len;
> +               *resid = rq->resid_len;
> +       if (rq->sense_len)
> +               memcpy(sense, rq->sense, SCSI_SENSE_BUFFERSIZE);
>         ret = req->errors;
>   out:
>         blk_put_request(req);

Hello Christoph,

Do we perhaps need a check before the above memcpy() call whether or not
sense == NULL?

Thanks,

Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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