[dpdk-stable] patch 'net/vmxnet3: handle bad host framing' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri May 22 11:39:55 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/24/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 733bc3f6391f89972e7c088785d7494de2dc80cd Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 12 May 2020 13:40:03 -0700
Subject: [PATCH] net/vmxnet3: handle bad host framing

[ upstream commit eb49f1671f30ede5121373e633c529b75993a6b2 ]

The VMXNet3 protocol has a start-of-packet (SOP) and end-of-packet (EOP)
marker. If there was a bug where mbuf arrived without SOP the code that
chains the mbuf would dereference a null pointer.
Also, record any mbuf's dropped in statistics.

Although did the initial code no longer have access to VMware.
Compile tested only!

Coverity issue: 124563
Fixes: 8ee787ce80a8 ("vmxnet3: remove asserts that confuse coverity")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Yong Wang <yongwang at vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index dd99684bee..73e270f30f 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -950,13 +950,17 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 			RTE_ASSERT(rxd->btype == VMXNET3_RXD_BTYPE_BODY);
 
-			if (rxm->data_len) {
+			if (likely(start && rxm->data_len > 0)) {
 				start->pkt_len += rxm->data_len;
 				start->nb_segs++;
 
 				rxq->last_seg->next = rxm;
 				rxq->last_seg = rxm;
 			} else {
+				PMD_RX_LOG(ERR, "Error received empty or out of order frame.");
+				rxq->stats.drop_total++;
+				rxq->stats.drop_err++;
+
 				rte_pktmbuf_free_seg(rxm);
 			}
 		}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-22 10:37:39.845391541 +0100
+++ 0016-net-vmxnet3-handle-bad-host-framing.patch	2020-05-22 10:37:39.100412212 +0100
@@ -1,8 +1,10 @@
-From eb49f1671f30ede5121373e633c529b75993a6b2 Mon Sep 17 00:00:00 2001
+From 733bc3f6391f89972e7c088785d7494de2dc80cd Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen at networkplumber.org>
 Date: Tue, 12 May 2020 13:40:03 -0700
 Subject: [PATCH] net/vmxnet3: handle bad host framing
 
+[ upstream commit eb49f1671f30ede5121373e633c529b75993a6b2 ]
+
 The VMXNet3 protocol has a start-of-packet (SOP) and end-of-packet (EOP)
 marker. If there was a bug where mbuf arrived without SOP the code that
 chains the mbuf would dereference a null pointer.
@@ -13,7 +15,6 @@
 
 Coverity issue: 124563
 Fixes: 8ee787ce80a8 ("vmxnet3: remove asserts that confuse coverity")
-Cc: stable at dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
 Acked-by: Yong Wang <yongwang at vmware.com>


More information about the stable mailing list