From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA259A0613 for ; Tue, 24 Sep 2019 12:55:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D4CD2BF5; Tue, 24 Sep 2019 12:55:36 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 23BC82BF1; Tue, 24 Sep 2019 12:55:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 03:55:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,543,1559545200"; d="scan'208";a="200865943" Received: from msmoczyx-mobl.ger.corp.intel.com ([10.103.104.109]) by orsmga002.jf.intel.com with ESMTP; 24 Sep 2019 03:55:31 -0700 From: Marcin Smoczynski To: konstantin.ananyev@intel.com, akhil.goyal@nxp.com Cc: dev@dpdk.org, Marcin Smoczynski , stable@dpdk.org Date: Tue, 24 Sep 2019 12:55:08 +0200 Message-Id: <20190924105508.19068-1-marcinx.smoczynski@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix over MTU packet crash 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" When sending an encrypted packet which size after encapsulation exceeds MTU, ipsec-secgw application tries to fragment it. If --reassemble option has not been set it results with a segmantation fault, because fragmentation buckets have not been initialized. Fix crashing by adding extra check: if --ressemble option has not been set and packet exceeds MTU after encapsulation - drop it. Fixes: b01d1cd213 ("examples/ipsec-secgw: support fragmentation and reassembly") Cc: stable@dpdk.org Signed-off-by: Marcin Smoczynski --- examples/ipsec-secgw/ipsec-secgw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 0d1fd6af6..91c602436 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -548,8 +548,10 @@ send_single_packet(struct rte_mbuf *m, uint16_t port, uint8_t proto) len++; /* need to fragment the packet */ - } else + } else if (frag_tbl_sz > 0) len = send_fragment_packet(qconf, m, port, proto); + else + rte_pktmbuf_free(m); /* enough pkts to be sent */ if (unlikely(len == MAX_PKT_BURST)) { -- 2.17.1