From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 74F0B8E6E for ; Tue, 12 Jan 2016 15:35:11 +0100 (CET) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O0U00NJ7GIM4A20@mailout2.w1.samsung.com> for dev@dpdk.org; Tue, 12 Jan 2016 14:35:10 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-a2-56950f1d792d Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 4A.31.21385.D1F05965; Tue, 12 Jan 2016 14:35:10 +0000 (GMT) Received: from fedinw7x64.rnd.samsung.ru ([106.109.131.169]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O0U00JHRGII1V50@eusync4.samsung.com>; Tue, 12 Jan 2016 14:35:09 +0000 (GMT) From: Pavel Fedin To: dev@dpdk.org Date: Tue, 12 Jan 2016 17:35:06 +0300 Message-id: <1452609306-7724-1-git-send-email-p.fedin@samsung.com> X-Mailer: git-send-email 2.4.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCJMWRmVeSWpSXmKPExsVy+t/xa7py/FPDDK6aWLz7tJ3Jonv2FzYH Jo9fC5ayeize85IpgCmKyyYlNSezLLVI3y6BK2Ph/8VMBYfZKnbf+MrYwLiLtYuRk0NCwERi ytF/TBC2mMSFe+vZuhi5OIQEljJK7H69lxnCaWOSeH91NhtIFZuAusTprx9YQGwRAQGJz52L weLMApoSnVf2MYLYwgKpEv2zl4LFWQRUJeZ8grB5BZwk7n+5A7VZTuLK9elsExi5FzAyrGIU TS1NLihOSs810itOzC0uzUvXS87P3cQI8evXHYxLj1kdYhTgYFTi4c1gnxImxJpYVlyZe4hR goNZSYR3A+fUMCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8M3e9DxESSE8sSc1OTS1ILYLJMnFw SjUw2j9eF3du17PCoorye9t4F72Ij/E74Wmy5bWVm/3m7H3TLd7OWeGxnues7+qZO/ZfUbm2 NSnVz/XyBwOVgN7IQ8Uh+5U8vdY6TWkTXPBHmb38RWbzkrkVhbGp35SO7IjaezrtTGcUn3hn qdfi+JDp6ntmSPnVn9ocfcxK56XMF8HTV7STO2rPKrEUZyQaajEXFScCADNTWt/nAQAA Subject: [dpdk-dev] [PATCH] vhost_user: Make sure that memory map is set before attempting address translation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 14:35:12 -0000 Malfunctioning virtio clients may not send VHOST_USER_SET_MEM_TABLE for some reason. This causes NULL dereference in qva_to_vva(). Change-Id: Ibc8f6637fb5fb9885b02c316adf18afd45e0d49a Signed-off-by: Pavel Fedin --- 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