From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2ED1BA0A02; Thu, 25 Mar 2021 04:08:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF80A140DC6; Thu, 25 Mar 2021 04:08:19 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 097B5140D9F; Thu, 25 Mar 2021 04:08:16 +0100 (CET) IronPort-SDR: tOVIh3oD59SnbkF9CRpc6NiOh2bQMgoWohW2UHosepgfiTR/vWeLcy8puRxOYkuvXNdQUt5JLs bSV/WIn6dSdQ== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="178390608" X-IronPort-AV: E=Sophos;i="5.81,276,1610438400"; d="scan'208";a="178390608" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 20:08:15 -0700 IronPort-SDR: 9ePbceKK/P/hRMaAPRgTo9o28AKvUbiY0TkvjnE0ggGZQiyexDfiWcJsHFyudC3ndtaaivIuVZ qoyvPYGPid3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,276,1610438400"; d="scan'208";a="452857878" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP; 24 Mar 2021 20:08:15 -0700 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 24 Mar 2021 20:08:14 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 25 Mar 2021 11:08:13 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2106.013; Thu, 25 Mar 2021 11:08:13 +0800 From: "Liu, Yong" To: Maxime Coquelin , "Xia, Chenbo" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] vhost: fix potential buffer overflow Thread-Index: AQHXDBG3Ny7xNFC/REeKnwuisSePSqqSeMKAgAG2dUA= Date: Thu, 25 Mar 2021 03:08:13 +0000 Message-ID: References: <20210226073321.66996-1-yong.liu@intel.com> <7daf5cb5-173f-ce38-b14e-5dc00fe970c8@redhat.com> In-Reply-To: <7daf5cb5-173f-ce38-b14e-5dc00fe970c8@redhat.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost: fix potential buffer overflow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogTWF4aW1lIENvcXVlbGlu IDxtYXhpbWUuY29xdWVsaW5AcmVkaGF0LmNvbT4NCj4gU2VudDogV2VkbmVzZGF5LCBNYXJjaCAy NCwgMjAyMSA0OjU2IFBNDQo+IFRvOiBMaXUsIFlvbmcgPHlvbmcubGl1QGludGVsLmNvbT47IFhp YSwgQ2hlbmJvIDxjaGVuYm8ueGlhQGludGVsLmNvb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