From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Sanford Subject: [PATCH 2/4] port: fix ring writer buffer overflow Date: Mon, 28 Mar 2016 16:51:35 -0400 Message-ID: <1459198297-49854-3-git-send-email-rsanford@akamai.com> References: <1459198297-49854-1-git-send-email-rsanford@akamai.com> To: dev@dpdk.org, cristian.dumitrescu@intel.com Return-path: Received: from mail-vk0-f68.google.com (mail-vk0-f68.google.com [209.85.213.68]) by dpdk.org (Postfix) with ESMTP id 3735537B4 for ; Mon, 28 Mar 2016 22:52:17 +0200 (CEST) Received: by mail-vk0-f68.google.com with SMTP id e185so16730808vkb.2 for ; Mon, 28 Mar 2016 13:52:17 -0700 (PDT) In-Reply-To: <1459198297-49854-1-git-send-email-rsanford@akamai.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Ring writer tx_bulk functions may write past the end of tx_buf[]. Solution is to double the size of tx_buf[]. Signed-off-by: Robert Sanford --- lib/librte_port/rte_port_ring.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_port/rte_port_ring.c b/lib/librte_port/rte_port_ring.c index b847fea..765ecc5 100644 --- a/lib/librte_port/rte_port_ring.c +++ b/lib/librte_port/rte_port_ring.c @@ -179,7 +179,7 @@ rte_port_ring_reader_stats_read(void *port, struct rte_port_ring_writer { struct rte_port_out_stats stats; - struct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX]; + struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; struct rte_ring *ring; uint32_t tx_burst_sz; uint32_t tx_buf_count; @@ -447,7 +447,7 @@ rte_port_ring_writer_stats_read(void *port, struct rte_port_ring_writer_nodrop { struct rte_port_out_stats stats; - struct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX]; + struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; struct rte_ring *ring; uint32_t tx_burst_sz; uint32_t tx_buf_count; -- 1.7.1