DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
@ 2016-01-13  7:32 Pavel Fedin
  2016-01-13  9:24 ` Xie, Huawei
  2016-02-21  9:54 ` Thomas Monjalon
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Fedin @ 2016-01-13  7:32 UTC (permalink / raw)
  To: dev

Malfunctioning virtio clients may not send VHOST_USER_SET_MEM_TABLE for
some reason. This causes NULL dereference in qva_to_vva().

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 lib/librte_vhost/virtio-net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
index 0ba5045..3e7cec0 100644
--- a/lib/librte_vhost/virtio-net.c
+++ b/lib/librte_vhost/virtio-net.c
@@ -630,7 +630,7 @@ set_vring_addr(struct vhost_device_ctx ctx, struct vhost_vring_addr *addr)
 	struct vhost_virtqueue *vq;
 
 	dev = get_device(ctx);
-	if (dev == NULL)
+	if ((dev == NULL) || (dev->mem == NULL))
 		return -1;
 
 	/* addr->index refers to the queue index. The txq 1, rxq is 0. */
-- 
2.1.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-02-21  9:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13  7:32 [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation Pavel Fedin
2016-01-13  9:24 ` Xie, Huawei
2016-01-13  9:40   ` Pavel Fedin
2016-01-13 12:48     ` Xie, Huawei
2016-01-15  8:10       ` Pavel Fedin
2016-01-18 17:29         ` Xie, Huawei
2016-02-21  9:54 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).