patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] virtio: fix buffer leak on vlan insert
@ 2019-04-05  0:03 Stephen Hemminger
  2019-04-05  7:43 ` [dpdk-stable] [dpdk-dev] " Jens Freimann
       [not found] ` <20190405163115.5068-1-stephen@networkplumber.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2019-04-05  0:03 UTC (permalink / raw)
  To: maxime.coquelin; +Cc: dev, stable, Stephen Hemminger

The function rte_vlan_insert may allocate a new buffer for the
vlan header and return a different mbuf than originally passed.
In this case, the stored mbuf in txm[] array could point to wrong
buffer.

Fixes: dd856dfcb9e7 ("virtio: use any layout on Tx")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_rxtx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index e6f3706d6fe1..2ae4232c181d 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -2003,6 +2003,8 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
 				rte_pktmbuf_free(txm);
 				continue;
 			}
+			/* vlan_insert may add a header mbuf */
+			tx_pkts[nb_tx] = txm;
 		}
 
 		/* optimize ring usage */
-- 
2.17.1


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

end of thread, other threads:[~2019-04-08  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05  0:03 [dpdk-stable] [PATCH] virtio: fix buffer leak on vlan insert Stephen Hemminger
2019-04-05  7:43 ` [dpdk-stable] [dpdk-dev] " Jens Freimann
     [not found] ` <20190405163115.5068-1-stephen@networkplumber.org>
2019-04-08  9:21   ` [dpdk-stable] [dpdk-dev] [PATCH v2] " Jens Freimann

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