From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=BaqT0fmm/uGm1xBrmzXs0h/WwyAPezyvab9j1AEE3gc=; b=GeS5J2aIxgmG++MfH0ySQGBKSiB+lCK5pJkHm21W1CefCTH25mrF02ZS0P7XwVAYMf U2F93skLzPNFlzt0JsMldSnIqANnEnK5drUtLaJH9rJffROod971+kVIAPwOH1Cs9nPb uknYmxENRcRwE2bEFF9CCygLkzm1Af8LgQIdWOITGkET768jG0Fw0q1xa8ny52Gc+AFR OJVAcVRKOZV8g5uK56xBqqunISSv5iVW8YBJ7WfuV+9OhZAXfC7bfN+1NhT/e6drekx0 qIlusolqnVL2n3izibuq5crdrtHzQh1lG+y6X0mmTGqhtCHFgCEYztDsBagIezcgaycV 3+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=BaqT0fmm/uGm1xBrmzXs0h/WwyAPezyvab9j1AEE3gc=; b=KfkKHYWVmlYSzNSSBGM5nVZyCX5MU7U8DgaPS6NvZ2DYLZ6jGciZY48KYlD+hN6+es 7YODvdOHI4ShLtwrJ5VFd99H36877v3YEi+Rt7tcl3pGFDh8MqhZYUTNNGREgl+Duugb BtxnDxnemEaOLO3fkeh2UXnzhzdtbY08LjTZufZaAjrBTFtLROI0JXqZlijYNFUHCOoA TfWmyrGCM6l8qJDdVgPp+e5cg1xXPXwNsc0DdnXoBbiy1kdJbnnbSXan5BjKmeZshVot lIkSXKRf8yhFIUgVhKKTcXBvx1PaNdzcruTy8MQYRl+04C26alqdzygvUvU13v0DvmGd LPOQ== X-Gm-Message-State: AD7BkJINBSsr6Yazn4K6a+zH1veyIQ76DLqKdRyr6ol6Zod8EqsI/tlJ1qZO7o9eZ36ImQ== X-Received: by 10.176.64.129 with SMTP id i1mr4060405uad.153.1459198336802; Mon, 28 Mar 2016 13:52:16 -0700 (PDT) Received: from localhost.localdomain ([23.79.237.14]) by smtp.gmail.com with ESMTPSA id v19sm4301389vkd.22.2016.03.28.13.52.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Mar 2016 13:52:16 -0700 (PDT) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org, cristian.dumitrescu@intel.com Date: Mon, 28 Mar 2016 16:51:35 -0400 Message-Id: <1459198297-49854-3-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1459198297-49854-1-git-send-email-rsanford@akamai.com> References: <1459198297-49854-1-git-send-email-rsanford@akamai.com> Subject: [dpdk-dev] [PATCH 2/4] port: fix ring writer buffer overflow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2016 20:52:17 -0000 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