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 4D453A0C47; Thu, 2 Sep 2021 14:46:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1142240041; Thu, 2 Sep 2021 14:46:22 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B09B24003E; Thu, 2 Sep 2021 14:46:18 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1825LH6t028347; Thu, 2 Sep 2021 05:46:17 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by mx0a-0016f401.pphosted.com with ESMTP id 3atrd2hgxr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Sep 2021 05:46:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hVApvhDZ9sXViiiumErRQTyYYTst5dQKh8qnd+S67SN9D6cBZ6eS5gbz0no80Lxnk0hXBkByRlyplDRmwFmqQHoA0QF89NFUzK+7fuIv4UlVzW33heFwfK0Gkf5TU0l9xEuexPckiIqSTh42R2P2rn/vpp4sCsjfeSLHeUuLRhL/ul0z9EApOKvQtIICZSRwSfXjEC1Q+AtZCAXSePOjG7KVdTk5Mm51hfKEega5YKuLl1RAbZBUKVHUPgGanr1KFf0MfqNEs2cy2q0qJ44rgp5odITE8zd0WYfBfhI+St6qVH8PTIsn8vzRyoz8pdPES7wfGKDdP0jdc+TL7xxX2w== 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; bh=S5RKygtBU2Ww4Zy1vG8NuAokmIXS5X0UYiafSBNVDXc=; b=dG2wfTCRqpKHFfStDSKaEj5OFMsMeYuyaz2h+7zywK6DIOSLPslmVDuKqg31TjgMkLfB6QyVQSIbuUikVKfpbSaaMIClL58rYXGIJa7+4Q9AkWMPHAawRwkTswWqwFa0+NdzeWVCNrHO3WmU9DNcRCplziA+5uvw3Mqb5LI8597jc/kJzwKP0cMWZ++CoRsWgDak0S8wFZ7/Ln6rL6e/C2m97eLLm5r4yBFQm+cUMBwHy4GsbY87nu03CqgAjemCEQoWM8lCy3NPKN0v6ZG3qpj9sRu7xdwHeMFaQp96xDeULkFGty56edYLfx7g451WPUEpDrHXKLJXTwnnKEhsbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S5RKygtBU2Ww4Zy1vG8NuAokmIXS5X0UYiafSBNVDXc=; b=Ja5Fy8znFJKTmWMHGRnjJZpV8jJrCG8uHmSzUfsPWSZdoT8zkcia9uUYhU8q47jaRLw5TBYcza+xjCQaF8tRAHG5MRXZo/uE1UAL11rHfAelsew/64y6JeApa4wa8H2DusqGBF/I51/bt7k89FlZfYey0hGqrkgJ5VCexnyEW3o= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4825.namprd18.prod.outlook.com (2603:10b6:303:ec::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Thu, 2 Sep 2021 12:46:15 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::411f:5b87:321e:de29]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::411f:5b87:321e:de29%4]) with mapi id 15.20.4478.022; Thu, 2 Sep 2021 12:46:14 +0000 From: Akhil Goyal To: Hemant Agrawal , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [EXT] [PATCH v2 01/11] crypto/dpaa2_sec: fix to check next null for auth only case Thread-Index: AQHXmYpSB3fOeupvpEqTpq28cJt49auQvI+A Date: Thu, 2 Sep 2021 12:46:14 +0000 Message-ID: References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=marvell.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0664fbf0-5f90-4034-72a0-08d96e0fa6ab x-ms-traffictypediagnostic: CO1PR18MB4825: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5xJqqPobaiDVT5XFB489AFlFChaRSnvLs6kLW8DC0Ias7VwBy4F19PrWro83r558akfRvH0KZtrHY5jbRrT217E088bYA5QN1vFM/yWjwBjmCwlDQMivHKt/HBxhZt1E6katYwZMC4Vml+WX1ZjaB5ypEQFShG/wLjj7zkwO3c95mzeYzU6N2kE/eM3EnrFuQSiCc2tZtenxskl+EWOBfBOZfXxNXEs8tJF4IaTVDhe+MJIPlC4WMSKQ2SCjsJ0emxrZDC9vZO1nu8EAClw01gANM5cY/mvVPXbgA1JSXcMDqXxhhmg5SIIcFTTsDhrYQ1+rYYoNfx49lkE4cm4bFroVGOraTNpOVZEfnBPGLQo203lAwbO5sz4aE360KNGlGLvaoP/Y+Ys93LVbufxMMD70/RulLphAUjzZNvFy3deS5XQtUVsDKLHOcRfRYCBUcQL0hJzNy472iK5NnU7fVJMk/iBwjQ/QLH7CzSLsGgR5U4rISNIoUXDIJ6B3S/0V1ilonfWA/Gu9gW5PBP45SYqxtbyKrMRk19nQRMLRUBhDjhRuMbTtkyYRo1CNMfR6cFVXP7lCp6SrCf1v4768BM/IjsP4107BK7CiMdeUidJVgHYUIXf7OHhCdRyaefW2CKxzkzJMvcCQC2LL6XBCydIe93X+kGEmAqwwAcOj9bCSHh0sd+xqA9CXzYjx7ozb9/3HveusloY6drai5CUdLg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(376002)(346002)(38100700002)(6506007)(122000001)(83380400001)(110136005)(55236004)(71200400001)(2906002)(8676002)(8936002)(33656002)(66556008)(66476007)(64756008)(66446008)(86362001)(66946007)(76116006)(52536014)(316002)(9686003)(55016002)(5660300002)(7696005)(4326008)(478600001)(186003)(38070700005)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8yTtm6zaC+2yqxPsQDyCehCXDuYyLKUvazcYzY2CipY+Czmfzf5tcpZWMWch?= =?us-ascii?Q?gnJROvr8XpTOv0LL2lKpW34oNIlbYcFW9UrNNk5EV1TlufAVwH18/EcKapSL?= =?us-ascii?Q?mWwzcJEd/wOdcb3P+zz9vTw4gZoNobHv3g4U5pYZGV47EYNn0Hj/NEsru8Mh?= =?us-ascii?Q?t9zU2UznFI4LGrpIWB10tC8pNBW4Mr/+/swYoFRdeHPOkxKpw+J+vuyBImpG?= =?us-ascii?Q?CaUQ6+3taOSzfgZwTmCtafy1P26GkLmY3jfWRHtqZpTQMfUkugFzsrOFRcIS?= =?us-ascii?Q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o53beKAK9wsTnHB?= =?us-ascii?Q?xi4QTtH33jGIqPXCDLOK/MF09Ws1zxfO3bicu62XPW2Ycyva9ACcstAFT3mv?= =?us-ascii?Q?KDOqyzj585lCDKBEQU2GztQvK1cww2BICjaQQGYz0re1hX6j0YLyyLUtnYQ1?= =?us-ascii?Q?9tZiOvpVuecc8FZ0ncwyy06l?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0664fbf0-5f90-4034-72a0-08d96e0fa6ab X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2021 12:46:14.7961 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8/qfde8wzfTcT8ROPa73DjfZrfFG297gfrpiEsguT7QF38k/i5Z9ylpXgf2/R83WHe1vEblk1B1o14G5PwoSOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4825 X-Proofpoint-GUID: T2bvH2rWIntSEUzrbtNbxBRoYOKLbA_3 X-Proofpoint-ORIG-GUID: T2bvH2rWIntSEUzrbtNbxBRoYOKLbA_3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-02_04,2021-09-02_01,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [PATCH v2 01/11] crypto/dpaa2_sec: fix to check next null for auth only case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > This patch fixes the issue to check for next pointer as > null in the integrity only case in pdcp-security context. >=20 > Fixes: bef594ec5cc8 ("crypto/dpaa2_sec: support PDCP offload") > Cc: stable@dpdk.org This patch is not a fix and need not be backported, because integrity only case is not a valid case for PDCP before the introduction of short MAC= . Since short MAC is supported here in this release only, this should be rewo= rded as to support short MAC, integrity-only case is required to be supported fo= r PDCP. And this patch should be part of the short MAC-I series and not this one. >=20 > Signed-off-by: Hemant Agrawal > --- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 25 +++++++++++---------- > 1 file changed, 13 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > index fe90d9d2d8..87a94b2c04 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -3095,7 +3095,7 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev > *dev, > struct rte_security_pdcp_xform *pdcp_xform =3D &conf->pdcp; > struct rte_crypto_sym_xform *xform =3D conf->crypto_xform; > struct rte_crypto_auth_xform *auth_xform =3D NULL; > - struct rte_crypto_cipher_xform *cipher_xform; > + struct rte_crypto_cipher_xform *cipher_xform =3D NULL; > dpaa2_sec_session *session =3D (dpaa2_sec_session *)sess; > struct ctxt_priv *priv; > struct dpaa2_sec_dev_private *dev_priv =3D dev->data->dev_private; > @@ -3127,18 +3127,18 @@ dpaa2_sec_set_pdcp_session(struct > rte_cryptodev *dev, > flc =3D &priv->flc_desc[0].flc; >=20 > /* find xfrm types */ > - if (xform->type =3D=3D RTE_CRYPTO_SYM_XFORM_CIPHER && xform- > >next =3D=3D NULL) { > - cipher_xform =3D &xform->cipher; > - } else if (xform->type =3D=3D RTE_CRYPTO_SYM_XFORM_CIPHER && > - xform->next->type =3D=3D RTE_CRYPTO_SYM_XFORM_AUTH) { > - session->ext_params.aead_ctxt.auth_cipher_text =3D true; > + if (xform->type =3D=3D RTE_CRYPTO_SYM_XFORM_CIPHER) { > cipher_xform =3D &xform->cipher; > - auth_xform =3D &xform->next->auth; > - } else if (xform->type =3D=3D RTE_CRYPTO_SYM_XFORM_AUTH && > - xform->next->type =3D=3D RTE_CRYPTO_SYM_XFORM_CIPHER) { > - session->ext_params.aead_ctxt.auth_cipher_text =3D false; > - cipher_xform =3D &xform->next->cipher; > + if (xform->next !=3D NULL) { > + session->ext_params.aead_ctxt.auth_cipher_text =3D > true; > + auth_xform =3D &xform->next->auth; > + } > + } else if (xform->type =3D=3D RTE_CRYPTO_SYM_XFORM_AUTH) { > auth_xform =3D &xform->auth; > + if (xform->next !=3D NULL) { > + session->ext_params.aead_ctxt.auth_cipher_text =3D > false; > + cipher_xform =3D &xform->next->cipher; > + } > } else { > DPAA2_SEC_ERR("Invalid crypto type"); > return -EINVAL; > @@ -3177,7 +3177,8 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev > *dev, > session->pdcp.hfn_threshold =3D pdcp_xform->hfn_threshold; > session->pdcp.hfn_ovd =3D pdcp_xform->hfn_ovrd; > /* hfv ovd offset location is stored in iv.offset value*/ > - session->pdcp.hfn_ovd_offset =3D cipher_xform->iv.offset; > + if (cipher_xform) > + session->pdcp.hfn_ovd_offset =3D cipher_xform->iv.offset; >=20 > cipherdata.key =3D (size_t)session->cipher_key.data; > cipherdata.keylen =3D session->cipher_key.length; > -- > 2.17.1