From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: Re: [PULL] vhost: cleanups and fixes Date: Thu, 1 Nov 2018 16:00:23 -0700 Message-ID: References: <20181101171938-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: Linus Torvalds , KVM , virtualization@lists.linux-foundation.org, Network Development , LKML , Andrew Morton , bijan.mottahedeh@oracle.com, gedwards@ddn.com, Joe Perches , lenaic@lhuard.fr, liang.z.li@intel.com, Michal Hocko , Michal Hocko , Stefan Hajnoczi , wei.w.wang@intel.com To: "Michael S. Tsirkin" Return-path: Received: from mail-yb1-f196.google.com ([209.85.219.196]:43890 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbeKBIF2 (ORCPT ); Fri, 2 Nov 2018 04:05:28 -0400 Received: by mail-yb1-f196.google.com with SMTP id g75-v6so41870yba.10 for ; Thu, 01 Nov 2018 16:00:28 -0700 (PDT) Received: from mail-yw1-f45.google.com (mail-yw1-f45.google.com. [209.85.161.45]) by smtp.gmail.com with ESMTPSA id k85-v6sm8381881ywa.76.2018.11.01.16.00.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 16:00:25 -0700 (PDT) Received: by mail-yw1-f45.google.com with SMTP id l2-v6so44090ywb.9 for ; Thu, 01 Nov 2018 16:00:25 -0700 (PDT) In-Reply-To: <20181101171938-mutt-send-email-mst@kernel.org> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Nov 1, 2018 at 2:19 PM, Michael S. Tsirkin wrote: > The following changes since commit 84df9525b0c27f3ebc2ebb1864fa62a97fdedb= 7d: > > Linux 4.19 (2018-10-22 07:37:37 +0100) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_li= nus > > for you to fetch changes up to 79f800b2e76923cd8ce0aa659cb5c019d9643bc9: > > MAINTAINERS: remove reference to bogus vsock file (2018-10-24 21:16:14 = -0400) > > ---------------------------------------------------------------- > virtio, vhost: fixes, tweaks > > virtio balloon page hinting support > vhost scsi control queue > > misc fixes. > > Signed-off-by: Michael S. Tsirkin > > ---------------------------------------------------------------- > Bijan Mottahedeh (3): > vhost/scsi: Respond to control queue operations +static void +vhost_scsi_send_tmf_resp(struct vhost_scsi *vs, + struct vhost_virtqueue *vq, + int head, unsigned int out) +{ + struct virtio_scsi_ctrl_tmf_resp __user *resp; + struct virtio_scsi_ctrl_tmf_resp rsp; + int ret; + + pr_debug("%s\n", __func__); + memset(&rsp, 0, sizeof(rsp)); + rsp.response =3D VIRTIO_SCSI_S_FUNCTION_REJECTED; + resp =3D vq->iov[out].iov_base; + ret =3D __copy_to_user(resp, &rsp, sizeof(rsp)); Is it actually safe to trust that iov_base has passed an earlier access_ok() check here? Why not just use copy_to_user() instead? -Kees > vhost/scsi: Extract common handling code from control queue handler > vhost/scsi: Use common handling code in request queue handler > > Greg Edwards (1): > vhost/scsi: truncate T10 PI iov_iter to prot_bytes > > L=C3=A9na=C3=AFc Huard (1): > kvm_config: add CONFIG_VIRTIO_MENU > > Stefan Hajnoczi (1): > MAINTAINERS: remove reference to bogus vsock file > > Wei Wang (3): > virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT > mm/page_poison: expose page_poisoning_enabled to kernel modules > virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON > > MAINTAINERS | 1 - > drivers/vhost/scsi.c | 426 ++++++++++++++++++++++++++++--= ------ > drivers/virtio/virtio_balloon.c | 380 +++++++++++++++++++++++++++++-=