[dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
Xie, Huawei
huawei.xie at intel.com
Wed Jan 13 10:24:18 CET 2016
On 1/13/2016 3:33 PM, Pavel Fedin wrote:
> Malfunctioning virtio clients may not send VHOST_USER_SET_MEM_TABLE for
> some reason. This causes NULL dereference in qva_to_vva().
Do you have examples for the malfunctioning clients? If so, could you
list them in the commit message?
>
> Signed-off-by: Pavel Fedin <p.fedin at samsung.com>
> Acked-by: Yuanhan Liu <yuanhan.liu at 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. */
More information about the dev
mailing list