Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9723BC433EF for ; Tue, 23 Nov 2021 12:49:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237229AbhKWMwx (ORCPT ); Tue, 23 Nov 2021 07:52:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28798 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237191AbhKWMwr (ORCPT ); Tue, 23 Nov 2021 07:52:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637671779; 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: in-reply-to:in-reply-to:references:references; bh=qq9RCNwYaWXQoI/gd2Bb1y62RmVls2Lwj4nIew3gKLU=; b=Tqdr/SNSDMVIKGhFdSW736EUGfTvhl6ztXQPkMEM2BdAdgVwS6CaDxGzP/WAgg5HCKHJAt KkCBW3Ga3W42fHZJM2ll/aktR8ycN7cknUc12SG0Gi7DrqrIcwK2cv1nxCzM6OW9+8SIc+ d9s/7bJdkVGmjbR/bGboSCOTmXg5X3w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-540-nsYRZ2KOM_2sPYaJknSsCg-1; Tue, 23 Nov 2021 07:49:33 -0500 X-MC-Unique: nsYRZ2KOM_2sPYaJknSsCg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0F55A87953E; Tue, 23 Nov 2021 12:49:32 +0000 (UTC) Received: from localhost (unknown [10.39.195.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id C74FC5F4E0; Tue, 23 Nov 2021 12:49:22 +0000 (UTC) Date: Tue, 23 Nov 2021 12:49:21 +0000 From: Stefan Hajnoczi To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, Halil Pasic , Jason Wang , Stefano Garzarella , "David S. Miller" , Jakub Kicinski , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, f.hetzelt@tu-berlin.de, david.kaplan@amd.com, konrad.wilk@oracle.com Subject: Re: [PATCH] vsock/virtio: suppress used length validation Message-ID: References: <20211122093036.285952-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CQhna4TCfJN2pG2B" Content-Disposition: inline In-Reply-To: <20211122093036.285952-1-mst@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --CQhna4TCfJN2pG2B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 22, 2021 at 04:32:01AM -0500, Michael S. Tsirkin wrote: > It turns out that vhost vsock violates the virtio spec > by supplying the out buffer length in the used length > (should just be the in length). > As a result, attempts to validate the used length fail with: > vmw_vsock_virtio_transport virtio1: tx: used len 44 is larger than in buf= len 0 >=20 > Since vsock driver does not use the length fox tx and > validates the length before use for rx, it is safe to > suppress the validation in virtio core for this driver. >=20 > Reported-by: Halil Pasic > Fixes: 939779f5152d ("virtio_ring: validate used buffer length") > Cc: "Jason Wang" > Signed-off-by: Michael S. Tsirkin > --- > net/vmw_vsock/virtio_transport.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Stefan Hajnoczi --CQhna4TCfJN2pG2B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmGc41EACgkQnKSrs4Gr c8h1hgf/VSC+i/I53x1gWPlapZR23ESGCMVD+7wgM6NTPM5rT+nqyAaq5IPNn9AH 08hZcOtgsKB2hi0yjlqQHhwFfOmsqF/OoEW/iQRkmNfXbNolhpdVojNOGGiKYPyF BJuI4BLniogr840wowG1cv0QYb2sfhOSRa+Lpm4YcC8+tvB2b8qgIPnAdj24e7Xc vuAUwNFrWcLImHqdDc/mhI5Tanz32oQn2WWFjJ4SdHK4f0KCnXZbs3dVqAI1BbEw Ryiy0Y8rBXeO1iOzk+HMiIw+msPkRxJbdqB+7bujClo15eNYZucU9NZuaM8j6ylJ 4/7+vFLiTMW4FaM+59sh925HLVglUA== =NGnu -----END PGP SIGNATURE----- --CQhna4TCfJN2pG2B--