From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com
[210.118.77.13]) by dpdk.org (Postfix) with ESMTP id 753C6370
for ; Wed, 13 Jan 2016 08:33:00 +0100 (CET)
Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245])
by mailout3.w1.samsung.com
(Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014))
with ESMTP id <0O0V00GTKRMZA310@mailout3.w1.samsung.com> for dev@dpdk.org;
Wed, 13 Jan 2016 07:32:59 +0000 (GMT)
X-AuditID: cbfec7f5-f79b16d000005389-52-5695fdaa9842
Received: from eusync4.samsung.com ( [203.254.199.214])
by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 46.7B.21385.AADF5965; Wed,
13 Jan 2016 07:32:58 +0000 (GMT)
Received: from fedinw7x64 ([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 <0O0V00KFTRMYIE00@eusync4.samsung.com>; Wed,
13 Jan 2016 07:32:58 +0000 (GMT)
From: Pavel Fedin
To: dev@dpdk.org
Date: Wed, 13 Jan 2016 10:32:57 +0300
Message-id: <005a01d14dd4$a02c5340$e084f9c0$@samsung.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-index: AdFN1GhdLYhVSclMQ5CF1dOJQ/fE9Q==
Content-language: ru
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRmVeSWpSXmKPExsVy+t/xa7qr/k4NM/i92NDi3aftTBbXJ1xg
dWDy+LVgKavHvJOBAUxRXDYpqTmZZalF+nYJXBn/r6xmLTjCVjFzC3cD43bWLkZODgkBE4nt
R49C2WISF+6tZ+ti5OIQEljKKLF17l1WCOc7o8SN9yfZQaqEBJQlHl5ewQxiswmoS5z++oEF
xBYREJD43LmYDcRmFpCX+D7/GVhcWKBcon3icyYQm0VAVWLhvCNgcV4BS4k3M5+yQtiCEj8m
32OB6NWSWL/zOBPMnM1r3jJDXKcgsePsa0YQm0cgXeLenL+sELapxNXVP9gg7BSJq/sXMELc
oyfxYE0D1D0iEtP+3WOewCgyC8m6WUjWzUKybhaSlgWMLKsYRVNLkwuKk9JzjfSKE3OLS/PS
9ZLzczcxQqLh6w7GpcesDjEKcDAq8fAazJgaJsSaWFZcmXuIUYKDWUmE1/gWUIg3JbGyKrUo
P76oNCe1+BCjNAeLkjjvzF3vQ4QE0hNLUrNTUwtSi2CyTBycUg2MZ25/E2f6MNes8oXKrn03
5zAFZ4QuNJlZosr55M8ltoAFd0IfLzo/q22ZnJLkqtWeNjNNtBzfh5d7qC1bs0BmzwsPGb7V
Ee/XJ8tynxA8xj5F2mh9+qstH5WE35plvZ3DmLP8mbPekWTWn7ecNuXZFN2wK1y6aJdayFMf
PosFRzj7l62JLjCYpcRSnJFoqMVcVJwIAJAA3Q+CAgAA
Subject: [dpdk-dev] [RESEND 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: Wed, 13 Jan 2016 07:33:00 -0000
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
Acked-by: Yuanhan Liu
---
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