Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1326467yba; Thu, 16 May 2019 19:24:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxuoyZGjNB+EyI4W8K7y620amzK58GHU7LncTeSrUjM7YJRFgW4uyuLH0iBNcsNw10wvWN X-Received: by 2002:a17:902:7594:: with SMTP id j20mr54580177pll.78.1558059853131; Thu, 16 May 2019 19:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558059853; cv=none; d=google.com; s=arc-20160816; b=JEL8jYbEqBoo3hhMIX3EBhji01Qn/8vt6mEWYT1smMknwSw+3xMBSHkStfjrhf5Hyu lRwAy3kAXHvzWxU1v+1PSp52RzC11Jj2vQewWtpxvVYjUKyWdyLaQ6CFPYlbicVPAeO+ U4a5vc7Fms6LCW1zVfiM5fo0o4rq2uH0rP0/IEnca1S3ooFR19/yqrOiTJwlDPoC4Rw5 QAH/xaMVITMLnCOSQWMGdTyKUoY0rV3iHxh8INeaOfIQLyGnxe09y4PHWpdInaYnnCpM +fkbFx+8hVIECvyzR93+UCPxtxfdkZKYR6H7iznmaMiRQeW3d6bRHB66N9j596gFvqBG wsrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=gO/WiyCif7660NjP94gMlaX8dE8wzulSonBDz7A8cvM=; b=VjdxROjZUInmmTNqsnA1d9WEM5EpFdlmy5A8u9oRjE/02VvejGeHImwcB+BAyrV2ft ApysGQvyQYiB7juBdNZ0o50fU/lO9ykXWGZzeevIOKAAuDWJpJk3lOAX0a8cFnlTXeCx A2/a391+c4XbaBdlMqoqJGyRG5txziGLZX5bWFKy9k3+6JVM42UP0yCDVPyjpJC/F+HH dkb6G6PYjnJHktboe+GkhjIHLnSVyjxy8gXFdufCZuSV/OXDOrcXuV7ZPi0HcjBeZoP8 XFKF8TvWWPuePiQ+nO5+VF4AIPupFnjVnGdQ1qOsjaSKYkHYTs8iO1TBEDgqsMH6ZfJ7 xiPw== 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 d16si5648773plr.408.2019.05.16.19.23.57; Thu, 16 May 2019 19:24:13 -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 S1727904AbfEQBFk (ORCPT + 99 others); Thu, 16 May 2019 21:05:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48488 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbfEQBFj (ORCPT ); Thu, 16 May 2019 21:05:39 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 3D4D430001DD; Fri, 17 May 2019 01:05:39 +0000 (UTC) Received: from [10.72.12.67] (ovpn-12-67.pek2.redhat.com [10.72.12.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58EBB7941E; Fri, 17 May 2019 01:05:32 +0000 (UTC) Subject: Re: [PATCH net 3/4] vhost: vsock: add weight support To: Stefan Hajnoczi 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 References: <1557992862-27320-1-git-send-email-jasowang@redhat.com> <1557992862-27320-4-git-send-email-jasowang@redhat.com> <20190516093352.GQ29507@stefanha-x1.localdomain> From: Jason Wang Message-ID: <70c24182-9238-1a69-8e35-53c98b957bc7@redhat.com> Date: Fri, 17 May 2019 09:05:30 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190516093352.GQ29507@stefanha-x1.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 17 May 2019 01:05:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/5/16 下午5:33, Stefan Hajnoczi wrote: > 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); >> >> virtio_transport_free_pkt(pkt); >> - } >> + total_len += pkt->len; > Please increment total_len before virtio_transport_free_pkt(pkt) to > avoid use-after-free. Right, let me fix this. Thanks