Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp436739ybt; Fri, 10 Jul 2020 03:51:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4cw6h1eFAHKxvrIx3K0R2thT4pjppvOihvXuG2FpN5N0qGjLDZwW52ZLig235iS5xgODt X-Received: by 2002:a05:6402:363:: with SMTP id s3mr64075696edw.238.1594378306576; Fri, 10 Jul 2020 03:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594378306; cv=none; d=google.com; s=arc-20160816; b=bt+M8J64bSeweULrwWp16YdoJnwBL+ox/djQmRlNsXT2mDWmec8T2rnytA5vRyAOEQ oERAcbAYv0GFPBFBW8OzP4xkv/fCmvno6sCuzAAEddyDUoBtmaX8RAjwY7sbpCfRlEgC zwC4yMR3lRGRPmgH8Uct7QLh6/6mq61yipLeiJ+vruf10SBy5/ImPgp8iotvrQQzJve9 jca5OyaMYyxj5cpbfMEfflP/iULD2yxdGReuukGkdJHGopNW5obMSMv8c163PbotG6Fn 1Gaxn5a6jo+UMSe/x5+ZgXPsWSqhWUDRUZzxGnySssacZ2k2b5KFZS75jg+YT8pgVFAu XvTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=zH+SoJc9FA+IxVxr5cux+vmHnM4kK2aczPlNcB2fA0g=; b=luckLRXIGaDpYEXSrTmh89GYRNeExx3ucA4IxxqZUg4Sak8Zc+EC+gZ7kB8L9xUZUg tuhS37aZTcvkoxYSjBFE5IVXLE11nCNLQooKELBwUUr7C8N+2LKHMcNgBdL/4frI4VRG Ah03heZw62QIwLfGS3TGsPdx2VJtvrFYgYfTPyPnDOvyfjiQBRxDmiHZ9c5+aLwWVAiK 28bc9TK9NslOJcCV/lqoGmoiOmAo1ENeTEP8lC1f//zVKGgb0TQi+m+fKSRnwajH+IDg +z/7Nqpu2aRrcSaHixUT82vKitiu40VOgXCQ2Xrwxj3FcqVijf4+5KOvgA2netVA5bJE sF3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CCu6qD2x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si3484055ejj.300.2020.07.10.03.51.22; Fri, 10 Jul 2020 03:51:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CCu6qD2x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727951AbgGJKs7 (ORCPT + 99 others); Fri, 10 Jul 2020 06:48:59 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:22045 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727944AbgGJKs6 (ORCPT ); Fri, 10 Jul 2020 06:48:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594378137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=zH+SoJc9FA+IxVxr5cux+vmHnM4kK2aczPlNcB2fA0g=; b=CCu6qD2xeuXD069jcmoAyMEpEqxMptebGue8VtnvIK71BNbBpDu2Uhj6MhZbHVbf5wDhw2 5QvKiyVisdPw9WDhy8i9SGwBF1Yun3fu7ZbtFEpc1pVXW78SsAgJJfmgCWWXsYkcHCsoUR uCpprH09Vdk1880Mmqc8g4ItfM/nRUU= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-g7GDDSAnO3eHdRBzfMbPrg-1; Fri, 10 Jul 2020 06:48:55 -0400 X-MC-Unique: g7GDDSAnO3eHdRBzfMbPrg-1 Received: by mail-wm1-f69.google.com with SMTP id g6so6361899wmk.4 for ; Fri, 10 Jul 2020 03:48:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=zH+SoJc9FA+IxVxr5cux+vmHnM4kK2aczPlNcB2fA0g=; b=F0tOVJ1rU3DFRLuzemxIsr+SlJmDuDB7MCioy6RQ5oTD91FDa5jnUCcIrclhqY6jky RMRd1nt3YQ0e0wGE/86EYWsV3zBkrqs9Lx4GA4qdYL39JjMd3T6ECiv00dYlqU3VGM9Y aTPqpzm80iZpcZJmpp/kwqE7iUmRxoJ3yhQjhWsGywfu2FUCQVWoUxzXuqxGwp+JPLfk r/i+dy4T0IIsjPs5092E0otIPDi/jbZeLLYa8moFEI926LIkc/xe2KBkWexmY4r8u1u6 GcjqizXXAY9boEjTScuGxelz8Qiv+XO5DrYkJvJ3Ug76n5mhBN8NNHGpXH1EdlAbbRlE i8vw== X-Gm-Message-State: AOAM533uRywe5yqhzAYg4Y1khINrVZNsZyqq7ZZAyeDESm/wmDaB9WBc Dpv/uma7rilcu+uGZIMqPXFrvUB8JdFWeTkL7PnKC7iiHAeFIw5tiif8MZsg4pbsuvIocg0ZsN/ f+aVAltTFHsh/JEMhTBYh57/t X-Received: by 2002:a05:6000:1143:: with SMTP id d3mr55214241wrx.235.1594378134133; Fri, 10 Jul 2020 03:48:54 -0700 (PDT) X-Received: by 2002:a05:6000:1143:: with SMTP id d3mr55214221wrx.235.1594378133933; Fri, 10 Jul 2020 03:48:53 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id 68sm8898710wmz.40.2020.07.10.03.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 03:48:53 -0700 (PDT) Date: Fri, 10 Jul 2020 06:48:51 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Jason Wang , Paolo Bonzini , Stefan Hajnoczi , virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] vhost/scsi: fix up req type endian-ness Message-ID: <20200710104849.406023-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vhost/scsi doesn't handle type conversion correctly for request type when using virtio 1.0 and up for BE, or cross-endian platforms. Fix it up using vhost_32_to_cpu. Cc: stable@vger.kernel.org Signed-off-by: Michael S. Tsirkin --- drivers/vhost/scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 6fb4d7ecfa19..b22adf03f584 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1215,7 +1215,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) continue; } - switch (v_req.type) { + switch (vhost32_to_cpu(vq, v_req.type)) { case VIRTIO_SCSI_T_TMF: vc.req = &v_req.tmf; vc.req_size = sizeof(struct virtio_scsi_ctrl_tmf_req); -- MST