From patchwork Wed Aug 23 07:05:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xie RongQiang X-Patchwork-Id: 27738 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 9F4137D53; Wed, 23 Aug 2017 09:06:45 +0200 (CEST) Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by dpdk.org (Postfix) with ESMTP id A73FB7D4F for ; Wed, 23 Aug 2017 09:06:40 +0200 (CEST) X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170823150220 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 23 Aug 2017 07:02:20 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v7N76JqI084881; Wed, 23 Aug 2017 15:06:19 +0800 (GMT-8) (envelope-from xie.rongqiang@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.43.166.171]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017082315062291-587302 ; Wed, 23 Aug 2017 15:06:22 +0800 From: Rongqiang XIE To: cristian.dumitrescu@intel.com Cc: dev@dpdk.org, Rongqiang XIE Date: Wed, 23 Aug 2017 15:05:32 +0800 Message-Id: <1503471932-22577-1-git-send-email-xie.rongqiang@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-08-23 15:06:22, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2017-08-23 15:06:11, Serialize complete at 2017-08-23 15:06:11 X-MAIL: mse01.zte.com.cn v7N76JqI084881 X-HQIP: 127.0.0.1 Subject: [dpdk-dev] [PATCH] lib/librte_pipeline:fix the array index out of bound X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In function rte_pipeline_compute_masks(), the value pos equal p->entries[i]->action,type constraint p->entries[i]->action is [0,4],but array action_mask1 size is 4,it possible attempt to access element 4 of array action_mask1.And also in function rte_pipeline_run(),it possible attempt to access element 4 of array action_mask0. Signed-off-by: Rongqiang XIE --- lib/librte_pipeline/rte_pipeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pipeline/rte_pipeline.c b/lib/librte_pipeline/rte_pipeline.c index 7f8fbac..2914445 100644 --- a/lib/librte_pipeline/rte_pipeline.c +++ b/lib/librte_pipeline/rte_pipeline.c @@ -155,8 +155,8 @@ struct rte_pipeline { /* Pipeline run structures */ struct rte_mbuf *pkts[RTE_PORT_IN_BURST_SIZE_MAX]; struct rte_pipeline_table_entry *entries[RTE_PORT_IN_BURST_SIZE_MAX]; - uint64_t action_mask0[RTE_PIPELINE_ACTIONS]; - uint64_t action_mask1[RTE_PIPELINE_ACTIONS]; + uint64_t action_mask0[RTE_PIPELINE_ACTIONS + 1]; + uint64_t action_mask1[RTE_PIPELINE_ACTIONS + 1]; uint64_t pkts_mask; uint64_t n_pkts_ah_drop; uint64_t pkts_drop_mask;