Re: VIRTIO_BLK_T_SCSI_CMD handling in virtio-blk

From: Christian Borntraeger
Date: Wed Mar 18 2009 - 05:37:34 EST


Am Wednesday 18 March 2009 10:16:43 schrieb Hannes Reinecke:
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂend_dequeued_request(vbr->req, uptodate);
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (blk_pc_request(vbr->req)) {
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvbr->req->data_len = vbr->in_hdr.residual;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂbytes = vbr->in_hdr.data_len;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvbr->req->sense_len = vbr->in_hdr.sense_len;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvbr->req->errors = vbr->in_hdr.status;
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ} else


I think we identified a bug in the old patch:
http://kerneltrap.org/mailarchive/linux-kvm/2008/8/29/3127594
http://kerneltrap.org/index.php?q=mailarchive/linux-kvm/2008/8/29/3128124

Is this fixup still valid?

- if (blk_pc_request(vbr->req)) {
+ if (blk_pc_request(vbr->req) && len >= sizeof(vbr->in_hdr)) {

I forgot almost all details about the problem.

Christian
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—