All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer
@ 2018-04-30  9:35 Maxime Coquelin
  2018-04-30  9:35 ` [PATCH 1/2] examples/vhost: fix header copy to discontiguous desc buffer Maxime Coquelin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-04-30  9:35 UTC (permalink / raw)
  To: dev, jianfeng.tan, tiwei.bie, john.mcnamara; +Cc: stable, Maxime Coquelin

This series fixes copying virtio net header to discontiguous descriptor
buffer in VA space.

The issue was spotted by Coverity for examples/vhost, but same issue
was present in vhost-user library.

Maxime Coquelin (2):
  examples/vhost: fix header copy to discontiguous desc buffer
  vhost: fix header copy to discontiguous desc buffer

 examples/vhost/virtio_net.c   | 2 +-
 lib/librte_vhost/virtio_net.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.14.3

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

* [PATCH 1/2] examples/vhost: fix header copy to discontiguous desc buffer
  2018-04-30  9:35 [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin
@ 2018-04-30  9:35 ` Maxime Coquelin
  2018-04-30  9:35 ` [PATCH 2/2] vhost: " Maxime Coquelin
  2018-05-04 15:14 ` [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-04-30  9:35 UTC (permalink / raw)
  To: dev, jianfeng.tan, tiwei.bie, john.mcnamara; +Cc: stable, Maxime Coquelin

In the loop to copy virtio-net header to the descriptor buffer,
destination pointer was incremented instead of the source
pointer.

Coverity issue: 277240
Fixes: 82c93a567d3b ("examples/vhost: move to safe GPA translation API")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 examples/vhost/virtio_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c
index 5a965a346..8ea6b36d5 100644
--- a/examples/vhost/virtio_net.c
+++ b/examples/vhost/virtio_net.c
@@ -103,7 +103,7 @@ enqueue_pkt(struct vhost_dev *dev, struct rte_vhost_vring *vr,
 
 			remain -= len;
 			guest_addr += len;
-			dst += len;
+			src += len;
 		}
 
 		desc_chunck_len = desc->len - dev->hdr_len;
-- 
2.14.3

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

* [PATCH 2/2] vhost: fix header copy to discontiguous desc buffer
  2018-04-30  9:35 [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin
  2018-04-30  9:35 ` [PATCH 1/2] examples/vhost: fix header copy to discontiguous desc buffer Maxime Coquelin
@ 2018-04-30  9:35 ` Maxime Coquelin
  2018-05-04 15:14 ` [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-04-30  9:35 UTC (permalink / raw)
  To: dev, jianfeng.tan, tiwei.bie, john.mcnamara; +Cc: stable, Maxime Coquelin

In the loop to copy virtio-net header to the descriptor buffer,
destination pointer was incremented instead of the source
pointer.

Fixes: fb3815cc614d ("vhost: handle virtually non-contiguous buffers in Rx-mrg")
Fixes: 6727f5a739b6 ("vhost: handle virtually non-contiguous buffers in Rx")

Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 5fdd4172b..eed6b0227 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -277,7 +277,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
 			vhost_log_write(dev, guest_addr, len);
 			remain -= len;
 			guest_addr += len;
-			dst += len;
+			src += len;
 		}
 	}
 
@@ -771,7 +771,7 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,
 
 					remain -= len;
 					guest_addr += len;
-					dst += len;
+					src += len;
 				}
 			} else {
 				PRINT_PACKET(dev, (uintptr_t)hdr_addr,
-- 
2.14.3

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

* Re: [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer
  2018-04-30  9:35 [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin
  2018-04-30  9:35 ` [PATCH 1/2] examples/vhost: fix header copy to discontiguous desc buffer Maxime Coquelin
  2018-04-30  9:35 ` [PATCH 2/2] vhost: " Maxime Coquelin
@ 2018-05-04 15:14 ` Maxime Coquelin
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-05-04 15:14 UTC (permalink / raw)
  To: dev, jianfeng.tan, tiwei.bie, john.mcnamara; +Cc: stable



On 04/30/2018 11:35 AM, Maxime Coquelin wrote:
> This series fixes copying virtio net header to discontiguous descriptor
> buffer in VA space.
> 
> The issue was spotted by Coverity for examples/vhost, but same issue
> was present in vhost-user library.
> 
> Maxime Coquelin (2):
>    examples/vhost: fix header copy to discontiguous desc buffer
>    vhost: fix header copy to discontiguous desc buffer
> 
>   examples/vhost/virtio_net.c   | 2 +-
>   lib/librte_vhost/virtio_net.c | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 

Applied to dpdk-next-virtio/master.

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

end of thread, other threads:[~2018-05-04 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-30  9:35 [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin
2018-04-30  9:35 ` [PATCH 1/2] examples/vhost: fix header copy to discontiguous desc buffer Maxime Coquelin
2018-04-30  9:35 ` [PATCH 2/2] vhost: " Maxime Coquelin
2018-05-04 15:14 ` [PATCH 0/2] Fix enqueueing vnet header in discontiguous decs buffer Maxime Coquelin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.