From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 3/3] vhost: fix possible out of bound access Date: Wed, 31 Oct 2018 18:28:19 +0100 Message-ID: References: <20181028010846.81730-1-ferruh.yigit@intel.com> <20181028010846.81730-3-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, stable@dpdk.org To: Ferruh Yigit , Tiwei Bie , Zhihong Wang Return-path: In-Reply-To: <20181028010846.81730-3-ferruh.yigit@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/28/18 2:08 AM, Ferruh Yigit wrote: > Fixes: d7280c9fffcb ("vhost: support selective datapath") > Cc: stable@dpdk.org > > Signed-off-by: Ferruh Yigit > --- > lib/librte_vhost/vdpa.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c > index c2c5dff1d..e7d849ee0 100644 > --- a/lib/librte_vhost/vdpa.c > +++ b/lib/librte_vhost/vdpa.c > @@ -63,6 +63,9 @@ rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr, > break; > } > > + if (i == MAX_VHOST_DEVICE) > + return -1; > + > sprintf(device_name, "vdpa-dev-%d", i); > dev = rte_zmalloc(device_name, sizeof(struct rte_vdpa_device), > RTE_CACHE_LINE_SIZE); > Reviewed-by: Maxime Coquelin Thanks, Maxime