vmxnet3: coverity reported defect
Subsystems (2)
I noticed Coverity defect in DPDK number 124563 was assigned to me.
It looks like vmxnet3 driver code doesn't handle case where host incorrectly sends a frame with out setting SOP bit in first segment. This would lead to rxq->start_seq being NULL.
Maybe something like this would fix it. I don't have VMware (or time) to test.
drivers/net/vmxnet3/vmxnet3_rxtx.c +7 -0
@@ -813,6 +813,13 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)RTE_ASSERT (rxd->btype ==VMXNET3_RXD_BTYPE_BODY ); +if (unlikely (start ==NULL )) { +PMD_RX_LOG (ERR ,"Missing sop" ); + +rte_pktmbuf_free_seg (rxm); + goto rcd_done; + } + start->pkt_len += rxm->data_len; start->nb_segs++;
PS: the email for the VMXNET3 maintainer Shrikrishna Khare <[email protected]> bounces.
Quoted 27 lines · Stephen Hemminger
I noticed Coverity defect in DPDK number 124563 was assigned to me.
It looks like vmxnet3 driver code doesn't handle case where host incorrectly sends a frame with out setting SOP bit in first segment. This would lead to
rxq->start_seqbeing NULL.Maybe something like this would fix it. I don't have VMware (or time) to test.
drivers/net/vmxnet3/vmxnet3_rxtx.c +7
-0@@ -813,6 +813,13 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)RTE_ASSERT (rxd->btype ==VMXNET3_RXD_BTYPE_BODY ); +if (unlikely (start ==NULL )) { +PMD_RX_LOG (ERR ,"Missing sop" ); + +rte_pktmbuf_free_seg (rxm); + goto rcd_done; + } + start->pkt_len += rxm->data_len; start->nb_segs++;
Quoted 1 line
PS: the email for the VMXNET3 maintainer Shrikrishna Khare <[email protected]> bounces.
Yong Wang send a patch [1] to take over vmxnet3 maintainership.
Quoted 16 lines · Stephen Hemminger
I noticed Coverity defect in DPDK number 124563 was assigned to me.
It looks like vmxnet3 driver code doesn't handle case where host incorrectly sends a frame with out setting SOP bit in first segment. This would lead to
rxq->start_seqbeing NULL.Maybe something like this would fix it. I don't have VMware (or time) to test.
drivers/net/vmxnet3/vmxnet3_rxtx.c +0
-0@@ -813,6 +813,13 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)RTE_ASSERT (rxd->btype ==VMXNET3_RXD_BTYPE_BODY );
drivers/net/vmxnet3/vmxnet3_rxtx.c vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) · line 825
Quoted 10 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +7
-0+if (unlikely (start ==NULL )) { +PMD_RX_LOG (ERR ,"Missing sop" ); + +rte_pktmbuf_free_seg (rxm); + goto rcd_done; + } + start->pkt_len += rxm->data_len; start->nb_segs++;
This looks reasonable to me, though my vmware instance is down at the moment, so I'm unable to test
Quoted 3 lines
PS: the email for the VMXNET3 maintainer Shrikrishna Khare <[email protected]> bounces.
I think it needs to be updated to point at [email protected], thats what they use in the kernel these days
Neil