Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp393565yba; Thu, 16 May 2019 02:36:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVFPKpOkL4CCRSbI4D5qjABIUp3xmCQBUwXruNXIKjQDA9IieixmPPkDva69r4C2x/6usb X-Received: by 2002:a62:3605:: with SMTP id d5mr31681331pfa.28.1557999384946; Thu, 16 May 2019 02:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557999384; cv=none; d=google.com; s=arc-20160816; b=bGzjx4ou0eGwFHcY0JAd9ExTuglNctD9KW2/HsToIgwBtJNyCBmHbdLt2cz61so/Po IY3b/ZP3kmhvi8xon5fav9QWKVe4iPsA9zd2ZMb6RV4RO2avRqA1Rn/CrFF0XA+1i1mp FRB8g0251kPflbqObWJeTbrB0RSneGUNbHm5U5VCSx5GagrrOd95kWKvSvCvcPQYxxSm 3RLhOua01B8Kuq9qR7xmMxfdpQwQAE+kglg8FVj+BYHvsNwnIDi72acptAvErZP1IMoh /q/ucgihPyzgyKwGjV8ud/hgKaq497IGEsbk06UD08eqFiOnE0M9I68NWIAt7WcHqE2c ArgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NxI+rv6HxssX/AjPuT+WshpuNt3DL9vbgqXZkjS3ibo=; b=lpmYHHrI3fRz/6iNBAiJC5NR9K1nJNMWxUD769OnyjiS9oDiYusV6uOyzVRA6fl7jU boZDyDo9IDYNjfcpccwowwA8SGWaFlyPWW2PBKrlKzU/U6yfaqJ8VeCJJXWk2XmfSi+u qtugFjXu1qPA/QcK5iyE/xvvsskb/QEtH/p6am+9L38+PF/sgzS4n5TBXCykm0Szg88B PUI5ACaG62UGwpu57NLvYt1zwyklXeygkh9TV1b5jlZLTVxy4mFer9OC5jzMlpiXngdp Ludx9hscsWCTA72ZbG7k7YP7rcY2PVcxdYOdMXHd7H1c9+1Gf3rM5MYNdYGnXxviCRdW yf6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o23si4219359pgm.595.2019.05.16.02.36.09; Thu, 16 May 2019 02:36:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727037AbfEPJd5 (ORCPT + 99 others); Thu, 16 May 2019 05:33:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46164 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfEPJd4 (ORCPT ); Thu, 16 May 2019 05:33:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C61E8307D945; Thu, 16 May 2019 09:33:56 +0000 (UTC) Received: from localhost (ovpn-117-183.ams2.redhat.com [10.36.117.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC6A9608A6; Thu, 16 May 2019 09:33:53 +0000 (UTC) Date: Thu, 16 May 2019 10:33:52 +0100 From: Stefan Hajnoczi To: Jason Wang Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com Subject: Re: [PATCH net 3/4] vhost: vsock: add weight support Message-ID: <20190516093352.GQ29507@stefanha-x1.localdomain> References: <1557992862-27320-1-git-send-email-jasowang@redhat.com> <1557992862-27320-4-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AFQGHouA0VN8Ovbt" Content-Disposition: inline In-Reply-To: <1557992862-27320-4-git-send-email-jasowang@redhat.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 16 May 2019 09:33:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --AFQGHouA0VN8Ovbt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 16, 2019 at 03:47:41AM -0400, Jason Wang wrote: > @@ -183,7 +184,8 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_= cid) > virtio_transport_deliver_tap_pkt(pkt); > =20 > virtio_transport_free_pkt(pkt); > - } > + total_len +=3D pkt->len; Please increment total_len before virtio_transport_free_pkt(pkt) to avoid use-after-free. --AFQGHouA0VN8Ovbt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAlzdLoAACgkQnKSrs4Gr c8garggAkwbbSkEoposz2FA5FIKLYtHjdQpn8NA8HSvaFqi/DcE0ejKYtN/BImRo 9Sed+GFqfzmP9ZIQni5Sh0boykMdrp8ZqK4JcFS4tTXZ4Ac0Smob4EA15WxIFX+p H35N34MvKnfTivYZKoezEXqFiiz8re5znN+PgUWWz1u/gOqK1XfmPayal3nP/c4v D3EYs+vIa4zOUsNI7g7Mn/KUG6z7kpMFsCKLzWWuInPsdFzKX3tE+xo907y8vlVX vympegUH07yJlISmuaTfKi2r2AmGOJEXq6nh1L4mIkHRVconV0GcU+Q33OT546Mq putACagRBiMVZtgw3+Fppx1fb9SvfA== =mlka -----END PGP SIGNATURE----- --AFQGHouA0VN8Ovbt--