From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C2E64A0C52 for ; Tue, 23 Nov 2021 14:10:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3DD7410F6; Tue, 23 Nov 2021 14:10:02 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 2B6DD4003C; Tue, 23 Nov 2021 14:09:58 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="215726979" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="215726979" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 05:09:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="456690621" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga003.jf.intel.com with ESMTP; 23 Nov 2021 05:09:57 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 23 Nov 2021 05:09:56 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 23 Nov 2021 05:09:56 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.171) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 23 Nov 2021 05:09:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RCZYo/7OHqbmR+IxC5KCB9vouHGH2iMxbMrLmXfTfa3unwO7io15WcSY5g/ihQQpS8xd3bDg4Gl+SwB/Iio2bYJo1pcYlR1393JUEQ0nC8pmTuZu1uSiOZyfF7XHx/WBFZeLK0KoRa6BjUZzUYMOOFJOJWC5MP+FdQrgJgxlC5rCCbr+DGlWEaosuE3TOfm23bD15GRn6cMZUTOYmOYCz+nEmE7GyjE7sr5mKPJkjsBptzPL9oQtUBshptW3Lk2bjPb2GrRxW0cn7IExDmzHdMvoKIrHbVXCFknZF1JQfbjOIgDPyRrBILsmEMqS9d8+rr6dgyqeHlkx+Eh6pYHtrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O0oC6HQ+T8PIVwFtrZDetORGU2HbFpEQ89ki9gFlkIw=; b=jCOJkmZ4TGpA/91GfI/etiBk8c6uikR3p+U/ZyUkTIhyYKVutHJxc5cTZCYSdhfWEH4CkHI1rZpWibxmPUHXD9sOx1atJB71d1t882NxH0n7QXZFTN9tk+EHS4zYePRKW/celT2nbZn5P1qoCfZFwE65pyTqPtGrQS5nYUMgrwyxZMsFkfk9P1XXT/OLwsCevrcbRU/BvI7W9H9UonFEAa2GHb7fbVnd0A4Jn7Pw8am/cEtOIEkAFdBycIUzG7fSa/RU6U3SjfHryKz/eL3t2q7QtNw+vBg3oMm/j77oHnLb1vPSU9brOB5ReqfCxsOZ+v9U8ke2wXIs1akCXTWa3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O0oC6HQ+T8PIVwFtrZDetORGU2HbFpEQ89ki9gFlkIw=; b=FaXJWzgPZZmlcJZZXQ2DGzM4UcRZ8Hs6PKazuUqrIuezw9a7HgbrBwJLRgHbGIe5U6yIbaf7xLU7O2pEEKxN6NdkC8aTszj1/mJWYL6rMAuTT+cVw8UVLYWYnRAd/Epvio2SFMREL37/X3pZow65nN2rjDv2JXVslWZ+MwrYcYk= Received: from MW5PR11MB5809.namprd11.prod.outlook.com (2603:10b6:303:197::6) by CO1PR11MB4820.namprd11.prod.outlook.com (2603:10b6:303:6f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.26; Tue, 23 Nov 2021 13:09:56 +0000 Received: from MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::410a:d2ae:ce7a:a8e4]) by MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::410a:d2ae:ce7a:a8e4%5]) with mapi id 15.20.4713.024; Tue, 23 Nov 2021 13:09:55 +0000 From: "Zhang, Roy Fan" To: "De Lara Guarch, Pablo" , "Power, Ciara" CC: "dev@dpdk.org" , "stable@dpdk.org" , "Akhil Goyal" Subject: RE: [PATCH] crypto/ipsec_mb: fix cipher key setting Thread-Topic: [PATCH] crypto/ipsec_mb: fix cipher key setting Thread-Index: AQHX38kW+W4dMzq4vUG/XWRXF9oFWawRFxfQ Date: Tue, 23 Nov 2021 13:09:55 +0000 Message-ID: References: <20211122174729.1153925-1-pablo.de.lara.guarch@intel.com> In-Reply-To: <20211122174729.1153925-1-pablo.de.lara.guarch@intel.com> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d1b95aa9-0ade-402b-b1cf-08d9ae828b84 x-ms-traffictypediagnostic: CO1PR11MB4820: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: g/awCSRlcqUmaaMSraK8nKfNf8SvThipz5mydtKQfImHjQ5eliZHIBiuRppirMGpdULpMWr12TUAzeS81mSOKX+uVx5QoFpOyIGkYsXyBTDv0XH4Cw1FVmr3+j6wbyeZDH1EKs7a660UFHrZEecoI9+I7Bjq2FxjSPfhWaigsrQ4fzlsaCqF/k/wL2GoB2vIsjK6m4rujUVf6WCS0cmPGyA8Bn0JF9w7wVe9qMLonzJhxCXlGVHvfVZF+drvS+0LJEQtotZc1GHkzElbWKphhIMJGxclkZHaAr+m33NAm9U8vhQG05IEYlXVhyloIhRnAAwozkdoPLc6rR6wwps43uaFjZ9o/qgDcWMZXgojexgvxkb3VG14rl6jN9dp4YuVkONTvf1YfPKHO7yXptTqvf5zIUZmEsoW4Pt56pWa99kYY6YkMLlb0XsNShnmIXtlKNIz8PARo84chnh2Jb0O5tqvL8yDes9W053uZWdUChWTASHkZQDmXJ66FNC1L/cwYoJKHpxX+83nrsi0jxmZRNp/Ulz5Inpqk3xw68FIf8k6xjnpUddll0HHKDCMS7BRFlvA1gZQkwwC69Mssycvn+M8m5OrjLm6Fn7daPpIpvKB1hw/znwN++tUHjY8o0GKsQO3b/dX15TFZo8IYOsjMpoNODW6Vn/SVvxoJrISrV+v7lF/E363NTZS8XbIlHAonlcTb1His/8cvCKTq3BxoA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR11MB5809.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(33656002)(64756008)(9686003)(316002)(76116006)(55016003)(71200400001)(8936002)(66446008)(66556008)(6506007)(122000001)(53546011)(86362001)(6636002)(52536014)(2906002)(7696005)(508600001)(83380400001)(4326008)(8676002)(186003)(5660300002)(82960400001)(38070700005)(54906003)(38100700002)(110136005)(26005)(66946007)(66476007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?YWxR1ZHiXcZAzCDou3JwscBkP9QwMNV4ebySsnC6q2hgLJtj+FcqFJlb?= =?Windows-1252?Q?q+2fFX+W3XwN+W4Fi5ITz9GUeeYBtw2iJQTf2kwuSlu6LY6ioUxQ/3Z3?= =?Windows-1252?Q?NC5CpWKbgj3ruil/9EqLObwKHaP9UkQMUfxqkwq4v23U8DcfwFVbZTv4?= =?Windows-1252?Q?8krXv+6FQVwmhphFghzQ3tiUhFa74ng3mUrqZBGpjxv5QygoEPutGO6g?= =?Windows-1252?Q?BfWaIQr8Z2uiHoBZ2PAVNyl2k/Bi8Q6SSwiH5wTY/oZaXNlHRf9lj1Om?= =?Windows-1252?Q?vdIGTF2tu3GpQlLVBVHVyMPTVn2ln770TUGAcGUTP04A3SvLo8NbAU5s?= =?Windows-1252?Q?0TKrcCHihD5DN4fDIXYz3VM71i9ES1yHZNmNFOoKvP2QSkKLRjZZm318?= =?Windows-1252?Q?fG6WHkGOfPl1HYC2j0qNbwS6nxt3uCC1aymcNDUQI5gcPZm7a1k7n3yS?= =?Windows-1252?Q?lZjYQbF/lpjtu6CECo0dIHWfqAxnbyfhOOM5K1/xB5I6caCA4bhezAP/?= =?Windows-1252?Q?lXexr0QSVbRH+d/RIydBlIhE+UdPDGiFVV9c8HtmCU2MvZTgl3Kiqld4?= =?Windows-1252?Q?ApWCKohsTkdkFh4YjMtmoxJ94MUov1FURvDuix6FyzpPAVV+zLPT3MMG?= =?Windows-1252?Q?GACXQaPwexeP7+gTvaNcO4VPNmi9WJHUL220bCtMWMYHmg/0extrIVgu?= =?Windows-1252?Q?Us8ayVxC9h1jKQmiOKugdGerr2VZQlcAUrIXWiV/uvuBpbBtn8N2vt51?= =?Windows-1252?Q?4V9oNq4aKGwb56gN7VaEr3k0AX3smUiWkwO2ul19nKuHRjicjx0D09OJ?= =?Windows-1252?Q?82xHWCWMdPtNPTZMrt/FHikZif9SFkcC3NQ3/uFuYYszKyUQHFwvipLR?= =?Windows-1252?Q?yCTulaTEeGNGDNnxKqSJoL1CaNzI6qxj5qMAtXPKCJFVaJrSWvpTDkx1?= =?Windows-1252?Q?dkGwnWcz5+733ZpzjWb5AoiRhxCXsoqixLKLg4MFfjjpngKqv97c/B3R?= =?Windows-1252?Q?xMMrXs64qpLDUvghWsrQvBuLLbJi6nBbAgTQ9MdfN5ajkMzL5Y9mCCBN?= =?Windows-1252?Q?q3HkxLSXU6QdbHI70b/vNVUJJqx9Inks1g6Z3yHnq5mb9vmmbU7ypDRy?= =?Windows-1252?Q?yqsjzc0LMLtb0yx3SNbqp43RZl4Oo2VFz38JquA4kFBmHlFNtMhn/FMC?= =?Windows-1252?Q?JRn8KFPzrcyfYxSiamogjYB2rDAxRF9MAMy0kkkoBLBjsrUWNjD3sDbn?= =?Windows-1252?Q?3nsaxappJteO2XiX4gGv+cCihbBrUojTCRocKHLNTP6GLJ+fUl9hBPmy?= =?Windows-1252?Q?PaANiBuDM1zKFF31QTLCnKiNRtE6yy71cJ++xUeJUr0Bkyv6/CER2p56?= =?Windows-1252?Q?01/cw8uWG8bjFUMWntKg4TGOH9cS04E+oHWmMsDrIGq2t0A7jxBxNaXW?= =?Windows-1252?Q?D1myYyIaEM6rKrjGFrAFjgV9TAFhfTxxgzk918GTnrN3F7+Bo1KkpbFO?= =?Windows-1252?Q?p42q6l8t7BRLg/U4WVVo4smrRpX5K44y3S0WkaJB0WCYDwCQP7VtpcRA?= =?Windows-1252?Q?dcz9sa+pAXqiMzhmQmZkaHH2s5yoFcRfW8h3lldEfEXyYsP3DNHb1fUs?= =?Windows-1252?Q?xNyoZ9HBQDrYDaSXlwQuGNkWVmwsxVWhrhhuCgWdIYiHQTYQf1Htar2i?= =?Windows-1252?Q?p/9NOPpepu/hAXXzdWfjEaeITBWyvvBch/ObhnDlMLscDkNAFhQ/oA?= =?Windows-1252?Q?=3D=3D?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5809.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1b95aa9-0ade-402b-b1cf-08d9ae828b84 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2021 13:09:55.8311 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MPOfhhJji42WfP9lHTDgiJ4p7QB6gd8Op+WabMfaR74Z6XCg8qCzawMML75DgOD9TUiaPGhhMRaQguAmW+sChQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4820 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Monday, November 22, 2021 5:47 PM > To: Zhang, Roy Fan ; Power, Ciara > > Cc: dev@dpdk.org; De Lara Guarch, Pablo ; > stable@dpdk.org > Subject: [PATCH] crypto/ipsec_mb: fix cipher key setting >=20 > When authenticating with SNOW3G, KASUMI and ZUC, > the pointers for encryption/decryption keys is not set. > If a cipher algorithm such as AES-CBC is also used, > the application would seg fault. > Hence, these pointers should be set to some value by default. >=20 > Command line to replicate the issue: > ./build/app/dpdk-test-crypto-perf -l 4,5 -n 6 --vdev=3D"crypto_aesni_mb" = -- \ > --devtype=3D"crypto_aesni_mb" --optype=3Dcipher-then-auth --auth-algo > snow3g-uia2 \ > --auth-key-sz 16 --auth-iv-sz 16 --digest-sz 4 --silent --total-ops 1000= 000 \ > --auth-op generate --burst-sz 32 --cipher-algo aes-ctr > --cipher-key-sz 16 --cipher-iv-sz 16 >=20 > Fixes: ae8e085c608d ("crypto/aesni_mb: support KASUMI F8/F9") > Fixes: 6c42e0cf4d12 ("crypto/aesni_mb: support SNOW3G-UEA2/UIA2") > Fixes: fd8df85487c4 ("crypto/aesni_mb: support ZUC-EEA3/EIA3") > Cc: stable@dpdk.org >=20 > Signed-off-by: Pablo de Lara > --- > drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > index e05bc04c3b..a308d42ffa 100644 > --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > @@ -1120,6 +1120,14 @@ set_mb_job_params(IMB_JOB *job, struct > ipsec_mb_qp *qp, >=20 > const int aead =3D is_aead_algo(job->hash_alg, job->cipher_mode); >=20 > + if (job->cipher_mode =3D=3D IMB_CIPHER_DES3) { > + job->enc_keys =3D session->cipher.exp_3des_keys.ks_ptr; > + job->dec_keys =3D session->cipher.exp_3des_keys.ks_ptr; > + } else { > + job->enc_keys =3D session- > >cipher.expanded_aes_keys.encode; > + job->dec_keys =3D session- > >cipher.expanded_aes_keys.decode; > + } > + > switch (job->hash_alg) { > case IMB_AUTH_AES_XCBC: > job->u.XCBC._k1_expanded =3D session- > >auth.xcbc.k1_expanded; > @@ -1189,13 +1197,6 @@ set_mb_job_params(IMB_JOB *job, struct > ipsec_mb_qp *qp, > job->u.HMAC._hashed_auth_key_xor_opad =3D > session->auth.pads.outer; >=20 > - if (job->cipher_mode =3D=3D IMB_CIPHER_DES3) { > - job->enc_keys =3D session- > >cipher.exp_3des_keys.ks_ptr; > - job->dec_keys =3D session- > >cipher.exp_3des_keys.ks_ptr; > - } else { > - job->enc_keys =3D session- > >cipher.expanded_aes_keys.encode; > - job->dec_keys =3D session- > >cipher.expanded_aes_keys.decode; > - } > } >=20 > if (aead) > -- > 2.25.1 Acked-by: Fan Zhang