From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B8EF7952 for ; Mon, 6 Mar 2017 14:26:40 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2017 05:26:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,253,1484035200"; d="scan'208";a="831459967" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by FMSMGA003.fm.intel.com with ESMTP; 06 Mar 2017 05:26:39 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX109.ger.corp.intel.com ([169.254.13.44]) with mapi id 14.03.0248.002; Mon, 6 Mar 2017 13:26:24 +0000 From: "De Lara Guarch, Pablo" To: "Mrzyglod, DanielX T" , "Mrozowicz, SlawomirX" , "Doherty, Declan" CC: "dev@dpdk.org" Thread-Topic: [PATCH v2] app/crypto-perf: fix for segfault when bad optype is used with gcm alghorithms Thread-Index: AQHSiEgEa84jOju7tUa7Iu1f7kMW2qGH6Ngg Date: Mon, 6 Mar 2017 13:26:23 +0000 Message-ID: References: <1487242128-154609-1-git-send-email-danielx.t.mrzyglod@intel.com> <1487244439-156256-1-git-send-email-danielx.t.mrzyglod@intel.com> In-Reply-To: <1487244439-156256-1-git-send-email-danielx.t.mrzyglod@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTRjMTkwMTEtMjA2Zi00MTQwLWI5NzQtN2M2NGE2NTNmZmVmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImtZUkwzZkFCRHpqWjJjc2F4SFBVZWJYMkZJZVI2aHZtYzNYOE5ZVXdSOWM9In0= x-ctpclassification: CTP_IC 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-dev] [PATCH v2] app/crypto-perf: fix for segfault when bad optype is used with gcm alghorithms 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: , X-List-Received-Date: Mon, 06 Mar 2017 13:26:41 -0000 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 wro= ng optype for AEAD algorithms" is better. >=20 > When somebody use bad --optype with aead alghorithms > segmentation fault could happen. >=20 > Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test > application") >=20 > Signed-off-by: Daniel Mrzyglod ... > --- > 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(-) >=20 > diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-cryp= to- > 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) > } > } >=20 > + if (options->cipher_algo =3D=3D RTE_CRYPTO_CIPHER_AES_GCM || > + options->auth_algo =3D=3D > RTE_CRYPTO_AUTH_AES_GCM || > + options->auth_algo =3D=3D > RTE_CRYPTO_AUTH_AES_GMAC) { I would expend this to AES_CCM as well, as it is another AEAD algorithm. > + if (options->op_type !=3D CPERF_AEAD) { > + RTE_LOG(ERR, USER1, "Use --optype aead\n"); > + return -EINVAL; > + } > + } > + > return 0; > } >=20 ... > 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 >=20 > + For GCM algorithms you should use aead flag. Include CCM here too. > + > * ``--sessionless`` >=20 > Enable session-less crypto operations mode. > -- > 2.7.4