[dpdk-stable] patch 'vhost: fix crash on NUMA' has been queued to stable release 17.05.1

Yuanhan Liu yliu at fridaylinux.org
Tue Jun 20 13:35:48 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.05.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/22/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 47d21fc57a6b52afbfc161001ea429125edbeb7b Mon Sep 17 00:00:00 2001
From: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Date: Fri, 2 Jun 2017 08:14:46 +0800
Subject: [PATCH] vhost: fix crash on NUMA

[ upstream commit ebd792b386097d40164c81e055a18f1adfa95d8d ]

The queue allocation was changed, from allocating one queue-pair at a
time to one queue at a time. Most of the changes have been done, but
just with one being missed: the size of copying the old queue is still
based on queue-pair at numa_realloc(), which leads to overwritten issue.
As a result, crash may happen.

Fix it by specifying the right copy size. Also, the net queue macros
are not used any more. Remove them.

Fixes: ab4d7b9f1afc ("vhost: turn queue pair to vring")

Reported-by: Ciara Loftus <ciara.loftus at intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Reviewed-by: Jens Freimann <jfreiman at redhat.com>
Tested-by: Ciara Loftus <ciara.loftus at intel.com>
---
 lib/librte_vhost/vhost_user.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 2cc0b66..2880881 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -242,8 +242,6 @@ numa_realloc(struct virtio_net *dev, int index)
 	struct vhost_virtqueue *old_vq, *vq;
 	int ret;
 
-	enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
-
 	old_dev = dev;
 	vq = old_vq = dev->virtqueue[index];
 
@@ -265,7 +263,7 @@ numa_realloc(struct virtio_net *dev, int index)
 		if (!vq)
 			return dev;
 
-		memcpy(vq, old_vq, sizeof(*vq) * VIRTIO_QNUM);
+		memcpy(vq, old_vq, sizeof(*vq));
 		rte_free(old_vq);
 	}
 
-- 
2.7.4



More information about the stable mailing list