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

* Re: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
  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-02-21  9:54 ` Thomas Monjalon
  1 sibling, 1 reply; 7+ messages in thread
From: Xie, Huawei @ 2016-01-13  9:24 UTC (permalink / raw)
  To: Pavel Fedin, dev

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@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. */


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

* Re: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
  2016-01-13  9:24 ` Xie, Huawei
@ 2016-01-13  9:40   ` Pavel Fedin
  2016-01-13 12:48     ` Xie, Huawei
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Fedin @ 2016-01-13  9:40 UTC (permalink / raw)
  To: 'Xie, Huawei', dev

 Hello!

> Do you have examples for the malfunctioning clients? If so, could you
> list them in the commit message?

 The only malfunctioning client was DPDK itself, with virtio for container RFC applied. The client-side problem has been fixed
afterwards by http://dpdk.org/ml/archives/dev/2016-January/031169.html. See the RFC discussion thread.

Kind regards,
Pavel Fedin
Senior Engineer
Samsung Electronics Research center Russia

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

* Re: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
  2016-01-13  9:40   ` Pavel Fedin
@ 2016-01-13 12:48     ` Xie, Huawei
  2016-01-15  8:10       ` Pavel Fedin
  0 siblings, 1 reply; 7+ messages in thread
From: Xie, Huawei @ 2016-01-13 12:48 UTC (permalink / raw)
  To: Pavel Fedin, dev

On 1/13/2016 5:40 PM, Pavel Fedin wrote:
>  Hello!
>
>> Do you have examples for the malfunctioning clients? If so, could you
>> list them in the commit message?
>  The only malfunctioning client was DPDK itself, with virtio for container RFC applied. The client-side problem has been fixed
> afterwards by http://dpdk.org/ml/archives/dev/2016-January/031169.html. See the RFC discussion thread.

If this is the case, i am wondering whether we should include
"malfunctioning clients" in commit message. It triggers me to think if
there are existing buggy implementations.

Anyway, check is OK.

> Kind regards,
> Pavel Fedin
> Senior Engineer
> Samsung Electronics Research center Russia
>
>
>


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

* Re: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
  2016-01-13 12:48     ` Xie, Huawei
@ 2016-01-15  8:10       ` Pavel Fedin
  2016-01-18 17:29         ` Xie, Huawei
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Fedin @ 2016-01-15  8:10 UTC (permalink / raw)
  To: 'Xie, Huawei', dev

 Hello!

> If this is the case, i am wondering whether we should include
> "malfunctioning clients" in commit message. It triggers me to think if
> there are existing buggy implementations.

 Well... Can you suggest how to rephrase it? May be "if a client is malfunctioning it can..."? I lack fantasy, really, and to tell
the truth i don't care that much about the exact phrasing, i'm OK with everything.

> Anyway, check is OK.

Kind regards,
Pavel Fedin
Senior Engineer
Samsung Electronics Research center Russia

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

* Re: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
  2016-01-15  8:10       ` Pavel Fedin
@ 2016-01-18 17:29         ` Xie, Huawei
  0 siblings, 0 replies; 7+ messages in thread
From: Xie, Huawei @ 2016-01-18 17:29 UTC (permalink / raw)
  To: Pavel Fedin, dev

On 1/15/2016 4:10 PM, Pavel Fedin wrote:
>  Hello!
>
>> If this is the case, i am wondering whether we should include
>> "malfunctioning clients" in commit message. It triggers me to think if
>> there are existing buggy implementations.
>  Well... Can you suggest how to rephrase it? May be "if a client is malfunctioning it can..."? I lack fantasy, really, and to tell
> the truth i don't care that much about the exact phrasing, i'm OK with everything.

Thanks.
Because there are not any existing malfunctioning clients which doesn't
send SET_MEM_TABLE message and we think the check is OK anyway,
personally I prefer simple phrases like: check memory table in
SET_VRING_ADDR message.

>
>> Anyway, check is OK.
> Kind regards,
> Pavel Fedin
> Senior Engineer
> Samsung Electronics Research center Russia
>
>
>


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

* Re: [dpdk-dev] [RESEND PATCH] vhost_user: Make sure that memory map is set before attempting address translation
  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-02-21  9:54 ` Thomas Monjalon
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2016-02-21  9:54 UTC (permalink / raw)
  To: Pavel Fedin; +Cc: dev

2016-01-13 10:32, Pavel Fedin:
> 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>

Applied, thanks

^ 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).