net/pcap: fix possible mbuf double freeing
authorAideen McLoughlin <aideen.mcloughlin@intel.com>
Thu, 11 Jul 2019 13:59:46 +0000 (14:59 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
In the eth_pcap_tx() and eth_pcap_tx_dumper() functions mbufs were freed
without incrementing num_tx.
This may lead application also try to free or use invalid mbuf.

To fix the issue, the mbuf freeing was removed.

Fixes: 6db141c91e1f ("pcap: support jumbo frames")
Cc: stable@dpdk.org
Signed-off-by: Aideen McLoughlin <aideen.mcloughlin@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/pcap/rte_eth_pcap.c

index 7ff6dc3..d1dca2a 100644 (file)
@@ -349,7 +349,6 @@ eth_pcap_tx_dumper(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                                        mbuf->pkt_len,
                                        RTE_ETHER_MAX_JUMBO_FRAME_LEN);
 
-                               rte_pktmbuf_free(mbuf);
                                break;
                        }
                }
@@ -435,7 +434,6 @@ eth_pcap_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                                        mbuf->pkt_len,
                                        RTE_ETHER_MAX_JUMBO_FRAME_LEN);
 
-                               rte_pktmbuf_free(mbuf);
                                break;
                        }
                }