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 175DAA00C2; Thu, 10 Feb 2022 05:32:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCE604117A; Thu, 10 Feb 2022 05:32:10 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) by mails.dpdk.org (Postfix) with ESMTP id 96A4841178; Thu, 10 Feb 2022 05:32:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j24pA1ZvU2sYaTNhPGLsm3JkmcfLN5Qau+IYo3I2E9caTF7zGa/rq6cDkjwfuZiysQf9px7MjhM8pvCNJ1PV1seUd0n4Q30eVJX4pUaNYRPbePDa1VpB83xE2j9yIffRTH+nelhXiFcMrGL0rBgxpLarYJIEa67Ie4v1WyFRBBYhvqAMYOVm5uTXL/aBQjt0xZbmf9Rr3BvPBQGF94Yrva+fvDEKdyDyuCCesgAcOzo3BDJG4tmbJxCeljnnNSYvaTA6o6/STjFyAsBD8VkxqePaKReJyRizTXcVoaaY5BrLEPA5P4ui4VdEtpG3uxCgjuJdgZsWuikxUyVkwxPQXw== 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=od8+ze1HcDD9aqPJmECWjvbNrpZkxMpHyJuI/YyggWw=; b=jB0FZakQgfdQGSuUwW/TwjegORrXV1Wyo770BEhf4hbDAEvKvwgd7laLROfdKT+p6mQ2LHqXHsVwUJ5YuIHaD4CrbpcewRNWXqOfUm4NI5vGbkurdwGcbq+zuq8Gbq5AAUlXlonCZeuEEt75iCNXQGzD/vHdgJZAuNBl+u48Nlppr3h/fyFAFnd/i075vuodCQZk4S+sqU8B6/jUu3hqqpOtdnYyBlPTaJvYQW3th4ciAn1BI6dqndjyVOyiBKTgeeYomY0CeTosqR4bpLfAXwu2MouF2tKTsj3JEiUw/gtjpT/lRsiSAZ3dBIyQL8HdECRYHOmAYUZMy387wEFA1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=od8+ze1HcDD9aqPJmECWjvbNrpZkxMpHyJuI/YyggWw=; b=okg/iipXDBUv94Bx0GS8sxwzsvsbgCu0DpYO+FDAdpy+458aP9FVKmKI78tUVNZlHcap5XqYqoCeLkvlRMPOSow51zxnZ8JOvqLQIOKtNmaykXmowPR8DzDNn85Af85EMt3sQJ/83UVIfL5Tyl8qx5g+wwpNjvG67jJler4IrJQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by DBBPR04MB6106.eurprd04.prod.outlook.com (2603:10a6:10:c5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 04:32:08 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::4146:965b:5645:9269]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::4146:965b:5645:9269%4]) with mapi id 15.20.4975.011; Thu, 10 Feb 2022 04:32:08 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Hemant Agrawal , stable@dpdk.org Subject: [PATCH v3 5/7] crypto/dpaa2: fix to check next type for auth or cipher Date: Thu, 10 Feb 2022 10:01:34 +0530 Message-Id: <20220210043136.304845-6-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210043136.304845-1-g.singh@nxp.com> References: <20211228091058.3620177-2-g.singh@nxp.com> <20220210043136.304845-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG3P274CA0003.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::15) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5454902-0c1b-4912-f9f8-08d9ec4e4c72 X-MS-TrafficTypeDiagnostic: DBBPR04MB6106:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1728; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Zt9Ws76pjiREteFnVxhFpnXfBqvXNo2vjWJAYoFyhZ0o/0o7Ek3FkqYSMIMyN0+lOB3BzL9qS3j/lm8rmeBbV94LMdAK6j/Zmob9Pspz7Ibv+n1fndapq+kcBtFVc+hVciuHWJZt0W1ZGg/SMPAhDnUN/3x/PeUykrayvixL824kWSYBnh6GWAlHDvttqzRBw778Vk1azbSuSUOfK4MCWzPeK6xr7get3WFWiviBH9FzwYsS9uXklBqiLKge4NXlaFQV08RedsbcELtQ9UtBH0yqBpAqo+RG5T1Cs/so+dMtiGPp+3tXAzPrXgNZXPaacRLtd/y2vVmVzz0rujzFqxDto94S66xWwhUdSLw9lBgRM88u+Fsp/rS9m5bZPe//I8AGYYJ2N1Gg1dXjBZRhpI0plccrPyBJ3oMCJTKm189noVJ4uKfG2P0RVCaaMLR0+FnLz/073UCWTU/uckT1pyTB8wx/kUSTvDN7uuE3SlzW6VOirmlwbEtwNB/LwLwOBHURxZN+FLvOULWWZ0syYuM+WuM7QOXR8f7kQXv+OMMckaJM/ouTlaMXMHl8NvIGUdxDLhBDLdG3Tmtz6iFJwSRrGG1/iuEyPTonBybjLEqIufE99Q50lDgrP4iCEqcVlHUzOICIUjqZjm2pDRNAHqGalTGJQ9BM/db3eZpKws8We7AkRVKN0cJzhF6fVC08yUyUnJU+kAiILmvHu3dwA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66556008)(6486002)(316002)(66946007)(4326008)(66476007)(8676002)(508600001)(36756003)(86362001)(38350700002)(38100700002)(1076003)(186003)(55236004)(52116002)(6512007)(2616005)(6666004)(26005)(6506007)(83380400001)(5660300002)(8936002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KRFHR7qq4ldHToBTmMUH95vdMgwgPZ87O0qajXJZQVJE9X17ZKWevnOGyX8q?= =?us-ascii?Q?GcGGECCmTT2uOnEaX6+flPfglL8E8yM8TOdfEdG0QvXSwKOT0rYeFkuoO3sa?= =?us-ascii?Q?kaPVMa04LQq2lSNZj+rrEqQasVNLbsaQNsffJCPMtmzDYXPULJwLg20S830T?= =?us-ascii?Q?Acpt242PFL6UU/PNYay4HDg/XCTp0xvodOMJDADqYv8PhBwcjbOPKknSYZeT?= =?us-ascii?Q?2AJ+ljt81FbJ1CPaNdOEAcymhUr/i85uHo/wqVVxYb6smzW/RAzlVMLok4kK?= =?us-ascii?Q?D0AShF3flvEbtT4ttDNU01tM0E36iZJJErg1HGkmx76VvHuGFimrnrmSTZMR?= =?us-ascii?Q?i6C7fEcLtOdH4E2wYLTlpyZX3PuZ4APjuOlo6x/wtp/MITGFF7/snvJp5C4v?= =?us-ascii?Q?6RQ4ssrDJdNK6oG17k94HTc33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?Q?BQH/h9RxNkzIuQ3zHX3C1mzYUSCh/y4c62tpFyM/YG2guzg+ewlY/Ee6CaPs?= =?us-ascii?Q?sOEtaCa+3KxGyJtwnxmX+NH0x9dnkIPSvbxSBf2ECCuCySl5B683B5P2xS2B?= =?us-ascii?Q?4Wg4M+RCzLLONxXH0feaztaAk9MgYaHwhcwcZm6w64QHOCLyowpXeR96j4sN?= =?us-ascii?Q?zoy3u+/2oJGEXiCKoQPGWd5cTeO/Ws8s3zE9KBWcjKsNms4ewSfp6W2MgUs7?= =?us-ascii?Q?dplkLWj8FqrFEz9Q4n8=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5454902-0c1b-4912-f9f8-08d9ec4e4c72 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 04:32:08.5718 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u6tK5HGP4G+q8WZ1iyJVrl136vHVxisIOC1NuejaVFrb6UqaK8zh8WnTMu1jITrS X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6106 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 From: Hemant Agrawal This patch add more checks on next type for PDCP cases. Fixes: 45e019608f31 ("crypto/dpaa2_sec: support integrity only PDCP") Fixes: a1173d55598c ("crypto/dpaa_sec: support PDCP offload") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++++-- drivers/crypto/dpaa_sec/dpaa_sec.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 444e1f0043..cb8aaf6446 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3231,13 +3231,15 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, /* find xfrm types */ if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { cipher_xform = &xform->cipher; - if (xform->next != NULL) { + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) { session->ext_params.aead_ctxt.auth_cipher_text = true; auth_xform = &xform->next->auth; } } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform = &xform->auth; - if (xform->next != NULL) { + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { session->ext_params.aead_ctxt.auth_cipher_text = false; cipher_xform = &xform->next->cipher; } diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 1dedd9eee5..af166252ca 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2984,11 +2984,13 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev *dev, /* find xfrm types */ if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { cipher_xform = &xform->cipher; - if (xform->next != NULL) + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) auth_xform = &xform->next->auth; } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform = &xform->auth; - if (xform->next != NULL) + if (xform->next != NULL && + xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) cipher_xform = &xform->next->cipher; } else { DPAA_SEC_ERR("Invalid crypto type"); -- 2.25.1