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 77195A0613 for ; Tue, 24 Sep 2019 13:27:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B0F12C58; Tue, 24 Sep 2019 13:27:45 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6E77E2C0C; Tue, 24 Sep 2019 13:27:41 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 04:27:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,543,1559545200"; d="scan'208";a="218594648" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 24 Sep 2019 04:27:39 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.164]) by IRSMSX103.ger.corp.intel.com ([169.254.3.36]) with mapi id 14.03.0439.000; Tue, 24 Sep 2019 12:27:38 +0100 From: "Ananyev, Konstantin" To: "Smoczynski, MarcinX" , "akhil.goyal@nxp.com" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] examples/ipsec-secgw: fix over MTU packet crash Thread-Index: AQHVcsadPmqkfIEfQ0K7Lhxrp5k2Hac6sFQw Date: Tue, 24 Sep 2019 11:27:38 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725801919699C7@irsmsx105.ger.corp.intel.com> References: <20190924105508.19068-1-marcinx.smoczynski@intel.com> In-Reply-To: <20190924105508.19068-1-marcinx.smoczynski@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2YxNDgyMWItMDBjNi00MjE4LTk1OTMtMTA0ZTE2NmMyOTQ4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiU1RZSkVwMVhYQ3NQejdERVF3YUNIczE3WDhyZHVxM3gyYXdxeHh3VTF1K1dTV3A4R1wvUjh5TlhwazJpK3FWSm4ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH] examples/ipsec-secgw: fix over MTU packet crash X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: Smoczynski, MarcinX > Sent: Tuesday, September 24, 2019 11:55 AM > To: Ananyev, Konstantin ; akhil.goyal@nxp.c= om > Cc: dev@dpdk.org; Smoczynski, MarcinX ; sta= ble@dpdk.org > Subject: [PATCH] examples/ipsec-secgw: fix over MTU packet crash >=20 > 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. >=20 > Fix crashing by adding extra check: if --ressemble option has not been > set and packet exceeds MTU after encapsulation - drop it. >=20 > Fixes: b01d1cd213 ("examples/ipsec-secgw: support fragmentation and reass= embly") > Cc: stable@dpdk.org >=20 > Signed-off-by: Marcin Smoczynski > --- > examples/ipsec-secgw/ipsec-secgw.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ip= sec-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++; >=20 > /* need to fragment the packet */ > - } else > + } else if (frag_tbl_sz > 0) > len =3D send_fragment_packet(qconf, m, port, proto); > + else > + rte_pktmbuf_free(m); >=20 > /* enough pkts to be sent */ > if (unlikely(len =3D=3D MAX_PKT_BURST)) { > -- Acked-by: Konstantin Ananyev > 2.17.1