DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Smoczynski, MarcinX" <marcinx.smoczynski@intel.com>,
	"akhil.goyal@nxp.com" <akhil.goyal@nxp.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix over MTU packet crash
Date: Tue, 24 Sep 2019 11:27:38 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB97725801919699C7@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <20190924105508.19068-1-marcinx.smoczynski@intel.com>



> -----Original Message-----
> From: Smoczynski, MarcinX
> Sent: Tuesday, September 24, 2019 11:55 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; akhil.goyal@nxp.com
> Cc: dev@dpdk.org; Smoczynski, MarcinX <marcinx.smoczynski@intel.com>; stable@dpdk.org
> Subject: [PATCH] examples/ipsec-secgw: fix over MTU packet crash
> 
> 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 <marcinx.smoczynski@intel.com>
> ---
>  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)) {
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.17.1


  reply	other threads:[~2019-09-24 11:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 10:55 Marcin Smoczynski
2019-09-24 11:27 ` Ananyev, Konstantin [this message]
2019-09-27 14:34   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2601191342CEEE43887BDE71AB97725801919699C7@irsmsx105.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=marcinx.smoczynski@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).