lkml.org 
[lkml]   [2014]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] vhost/scsi: Check LUN structure byte 0 is set to 1, per spec
From
Date
Hi Venkatesh,

On Mon, 2014-02-24 at 14:13 -0800, Venkatesh Srinivas wrote:
> The virtio spec requires byte 0 of the virtio-scsi LUN structure
> to be '1'.
>
> Signed-off-by: Venkatesh Srinivas <venkateshs@google.com>
> ---
> drivers/vhost/scsi.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 0a025b8..e48d4a6 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1001,6 +1001,12 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
> break;
> }
>
> + /* virtio-scsi spec requires byte 0 of the lun to be 1 */
> + if (unlikely(v_req.lun[0] != 1)) {
> + vhost_scsi_send_bad_target(vs, vq, head, out);
> + continue;
> + }
> +
> /* Extract the tpgt */
> target = v_req.lun[1];
> tpg = ACCESS_ONCE(vs_tpg[target]);

Applied to target-pending/master, and including in the next v3.14-rc
PULL request.

Thanks!

--nab



\
 
 \ /
  Last update: 2014-02-25 02:01    [W:0.057 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site