From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] librte_port: fix the buffer overflow for ring writer Date: Mon, 11 Apr 2016 22:35:13 +0200 Message-ID: <16410001.D3kMoyTPAi@xps13> References: <1460397337-237625-1-git-send-email-jasvinder.singh@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, cristian.dumitrescu@intel.com To: Jasvinder Singh Return-path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 085A7DE0 for ; Mon, 11 Apr 2016 22:35:20 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id n3so1536060wmn.0 for ; Mon, 11 Apr 2016 13:35:20 -0700 (PDT) In-Reply-To: <1460397337-237625-1-git-send-email-jasvinder.singh@intel.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" 2016-04-11 18:55, Jasvinder Singh: > Fixes the buffer overflow that occurs due to following; > > 1. When the input packet burst does not meet the conditions: (a) being > contiguous (first n bits set in pkts_mask, all the other bits cleared) > and (b) containing a full burst, i.e. at least tx_burst_sz packets > (n >= tx_burst_size). This is the slow(er) code path taken when local > variable expr != 0. > 2. There are some packets already in the buffer. > 3. The number of packets in the incoming burst (i.e. popcount(pkts_mask)) > plus the number of packets already in the buffer exceeds the buffer size > (RTE_PORT_IN_BURST_SIZE_MAX, i.e. 64). > > Fixes: bf6931b242f7 ("port: ring") > Fixes: 5f4cd47309d6 ("port: add ring writer nodrop") > > Signed-off-by: Jasvinder Singh > Acked-by: Cristian Dumitrescu Applied, thanks