patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/2] vhost: fix accessing uninitialized variables
@ 2021-04-07  3:25 Marvin Liu
  2021-04-07  3:25 ` [dpdk-stable] [PATCH 2/2] vhost: fix async enqueue " Marvin Liu
  2021-04-07  6:53 ` [dpdk-stable] [PATCH 1/2] vhost: fix " Xia, Chenbo
  0 siblings, 2 replies; 4+ messages in thread
From: Marvin Liu @ 2021-04-07  3:25 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia; +Cc: dev, Marvin Liu, stable

This patch fixs coverity issue by adding initialization step before
using temporary virtio header.

Coverity issue: 366181
Fixes: fb3815cc614d ("vhost: handle virtually non-contiguous buffers in Rx-mrg")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 7f621fb6dd..48b013a9b4 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -812,9 +812,10 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
 
 	hdr_mbuf = m;
 	hdr_addr = buf_addr;
-	if (unlikely(buf_len < dev->vhost_hlen))
+	if (unlikely(buf_len < dev->vhost_hlen)) {
+		memset(&tmp_hdr, 0, sizeof(struct virtio_net_hdr_mrg_rxbuf));
 		hdr = &tmp_hdr;
-	else
+	} else
 		hdr = (struct virtio_net_hdr_mrg_rxbuf *)(uintptr_t)hdr_addr;
 
 	VHOST_LOG_DATA(DEBUG, "(%d) RX: num merge buffers %d\n",
-- 
2.17.1


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

* [dpdk-stable] [PATCH 2/2] vhost: fix async enqueue accessing uninitialized variables
  2021-04-07  3:25 [dpdk-stable] [PATCH 1/2] vhost: fix accessing uninitialized variables Marvin Liu
@ 2021-04-07  3:25 ` Marvin Liu
  2021-04-07  6:14   ` Xia, Chenbo
  2021-04-07  6:53 ` [dpdk-stable] [PATCH 1/2] vhost: fix " Xia, Chenbo
  1 sibling, 1 reply; 4+ messages in thread
From: Marvin Liu @ 2021-04-07  3:25 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia; +Cc: dev, Marvin Liu, stable

This patch fixs coverity issue in async enqueue function by adding
initialization step before using temporary virtio header.

Coverity issue: 366123
Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 48b013a9b4..ff39878609 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -986,9 +986,10 @@ async_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
 
 	hdr_mbuf = m;
 	hdr_addr = buf_addr;
-	if (unlikely(buf_len < dev->vhost_hlen))
+	if (unlikely(buf_len < dev->vhost_hlen)) {
+		memset(&tmp_hdr, 0, sizeof(struct virtio_net_hdr_mrg_rxbuf));
 		hdr = &tmp_hdr;
-	else
+	} else
 		hdr = (struct virtio_net_hdr_mrg_rxbuf *)(uintptr_t)hdr_addr;
 
 	VHOST_LOG_DATA(DEBUG, "(%d) RX: num merge buffers %d\n",
-- 
2.17.1


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

* Re: [dpdk-stable] [PATCH 2/2] vhost: fix async enqueue accessing uninitialized variables
  2021-04-07  3:25 ` [dpdk-stable] [PATCH 2/2] vhost: fix async enqueue " Marvin Liu
@ 2021-04-07  6:14   ` Xia, Chenbo
  0 siblings, 0 replies; 4+ messages in thread
From: Xia, Chenbo @ 2021-04-07  6:14 UTC (permalink / raw)
  To: Liu, Yong, maxime.coquelin; +Cc: dev, stable

> -----Original Message-----
> From: Liu, Yong <yong.liu@intel.com>
> Sent: Wednesday, April 7, 2021 11:25 AM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Liu, Yong <yong.liu@intel.com>; stable@dpdk.org
> Subject: [PATCH 2/2] vhost: fix async enqueue accessing uninitialized
> variables
> 
> This patch fixs coverity issue in async enqueue function by adding
> initialization step before using temporary virtio header.
> 
> Coverity issue: 366123
> Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> 
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index 48b013a9b4..ff39878609 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -986,9 +986,10 @@ async_mbuf_to_desc(struct virtio_net *dev, struct
> vhost_virtqueue *vq,
> 
>  	hdr_mbuf = m;
>  	hdr_addr = buf_addr;
> -	if (unlikely(buf_len < dev->vhost_hlen))
> +	if (unlikely(buf_len < dev->vhost_hlen)) {
> +		memset(&tmp_hdr, 0, sizeof(struct virtio_net_hdr_mrg_rxbuf));
>  		hdr = &tmp_hdr;
> -	else
> +	} else
>  		hdr = (struct virtio_net_hdr_mrg_rxbuf *)(uintptr_t)hdr_addr;
> 
>  	VHOST_LOG_DATA(DEBUG, "(%d) RX: num merge buffers %d\n",
> --
> 2.17.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

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

* Re: [dpdk-stable] [PATCH 1/2] vhost: fix accessing uninitialized variables
  2021-04-07  3:25 [dpdk-stable] [PATCH 1/2] vhost: fix accessing uninitialized variables Marvin Liu
  2021-04-07  3:25 ` [dpdk-stable] [PATCH 2/2] vhost: fix async enqueue " Marvin Liu
@ 2021-04-07  6:53 ` Xia, Chenbo
  1 sibling, 0 replies; 4+ messages in thread
From: Xia, Chenbo @ 2021-04-07  6:53 UTC (permalink / raw)
  To: Liu, Yong, maxime.coquelin; +Cc: dev, stable

> -----Original Message-----
> From: Liu, Yong <yong.liu@intel.com>
> Sent: Wednesday, April 7, 2021 11:25 AM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Liu, Yong <yong.liu@intel.com>; stable@dpdk.org
> Subject: [PATCH 1/2] vhost: fix accessing uninitialized variables
> 
> This patch fixs coverity issue by adding initialization step before
> using temporary virtio header.
> 
> Coverity issue: 366181
> Fixes: fb3815cc614d ("vhost: handle virtually non-contiguous buffers in Rx-
> mrg")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> --
> 2.17.1

Series applied to next-virtio/main, Thanks

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

end of thread, other threads:[~2021-04-07  6:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  3:25 [dpdk-stable] [PATCH 1/2] vhost: fix accessing uninitialized variables Marvin Liu
2021-04-07  3:25 ` [dpdk-stable] [PATCH 2/2] vhost: fix async enqueue " Marvin Liu
2021-04-07  6:14   ` Xia, Chenbo
2021-04-07  6:53 ` [dpdk-stable] [PATCH 1/2] vhost: fix " Xia, Chenbo

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