DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Mrzyglod, DanielX T" <danielx.t.mrzyglod@intel.com>,
	"Mrozowicz, SlawomirX" <slawomirx.mrozowicz@intel.com>,
	"Doherty, Declan" <declan.doherty@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] app/crypto-perf: fix for segfault when bad optype is used with gcm alghorithms
Date: Mon, 6 Mar 2017 13:26:23 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D897476E943C@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1487244439-156256-1-git-send-email-danielx.t.mrzyglod@intel.com>

Hi Daniel,

> -----Original Message-----
> From: Mrzyglod, DanielX T
> Sent: Thursday, February 16, 2017 11:27 AM
> To: Mrozowicz, SlawomirX; Doherty, Declan; De Lara Guarch, Pablo
> Cc: dev@dpdk.org; Mrzyglod, DanielX T
> Subject: [PATCH v2] app/crypto-perf: fix for segfault when bad optype is
> used with gcm alghorithms

Typo in the title. Also, title is too long. Maybe something like "avoid wrong optype for AEAD algorithms" is better.

> 
> When somebody use bad --optype with aead alghorithms
> segmentation fault could happen.
> 
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>

...

> ---
>  app/test-crypto-perf/cperf_options_parsing.c | 9 +++++++++
>  app/test-crypto-perf/main.c                  | 6 ++++--
>  doc/guides/tools/cryptoperf.rst              | 2 ++
>  3 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-
> perf/cperf_options_parsing.c
> index c1d5ffc..215a07b 100644
> --- a/app/test-crypto-perf/cperf_options_parsing.c
> +++ b/app/test-crypto-perf/cperf_options_parsing.c
> @@ -829,6 +829,15 @@ cperf_options_check(struct cperf_options
> *options)
>  		}
>  	}
> 
> +	if (options->cipher_algo == RTE_CRYPTO_CIPHER_AES_GCM ||
> +			options->auth_algo ==
> RTE_CRYPTO_AUTH_AES_GCM ||
> +			options->auth_algo ==
> RTE_CRYPTO_AUTH_AES_GMAC) {

I would expend this to AES_CCM as well, as it is another AEAD algorithm.

> +		if (options->op_type != CPERF_AEAD) {
> +			RTE_LOG(ERR, USER1, "Use --optype aead\n");
> +			return -EINVAL;
> +		}
> +	}
> +
>  	return 0;
>  }
> 

...

> diff --git a/doc/guides/tools/cryptoperf.rst
> b/doc/guides/tools/cryptoperf.rst
> index 1fc40c4..9cb3338 100644
> --- a/doc/guides/tools/cryptoperf.rst
> +++ b/doc/guides/tools/cryptoperf.rst
> @@ -180,6 +180,8 @@ The following are the appication command-line
> options:
>             auth-then-cipher
>             aead
> 
> +        For GCM algorithms you should use aead flag.

Include CCM here too.

> +
>  * ``--sessionless``
> 
>          Enable session-less crypto operations mode.
> --
> 2.7.4

  reply	other threads:[~2017-03-06 13:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 10:48 [dpdk-dev] [PATCH] " Daniel Mrzyglod
2017-02-16 10:55 ` De Lara Guarch, Pablo
2017-02-16 11:27 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
2017-03-06 13:26   ` De Lara Guarch, Pablo [this message]
2017-03-08 17:03   ` [dpdk-dev] [PATCH v3] app/crypto-perf: fix avoid wrong optype for AEAD algorithms Daniel Mrzyglod
2017-03-09 21:34     ` De Lara Guarch, Pablo
2017-03-09 21:46       ` De Lara Guarch, Pablo

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=E115CCD9D858EF4F90C690B0DCB4D897476E943C@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=danielx.t.mrzyglod@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=slawomirx.mrozowicz@intel.com \
    /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).