From: Pavel Fedin <p.fedin@samsung.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
Date: Wed, 13 Jan 2016 10:32:57 +0300 [thread overview]
Message-ID: <005a01d14dd4$a02c5340$e084f9c0$@samsung.com> (raw)
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
next reply other threads:[~2016-01-13 7:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 7:32 Pavel Fedin [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='005a01d14dd4$a02c5340$e084f9c0$@samsung.com' \
--to=p.fedin@samsung.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).