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 9EDEFA00BE; Mon, 20 Dec 2021 11:28:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0443541160; Mon, 20 Dec 2021 11:27:54 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00061.outbound.protection.outlook.com [40.107.0.61]) by mails.dpdk.org (Postfix) with ESMTP id 70BEC4003C; Mon, 20 Dec 2021 11:27:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kaLKCFnfigLfKULwEvmalsSehn1JbarFTdzr10RYpIAjOHNuMVHvrzfNN6qg9gZuYTczBHNtLiyGhTuzQMfKNYoqLpz1i12PEYpuuXh3IMCSrv8XI24gdH2bMqRk6KQ7NoSEv1c8D8WhugFLaHuQGealHiMOPZE4pPTk1FmIwJvWXmJ+A/l7M4z5MR8LScOpoBRC2ivcC0IJG9OK3ZYSzwfEQsgXZc6ayUa/7tPIhIxSSp+yF1LpIqhzaJx3yBQCREky/VpRkd5VN2ne8AKqRKTcOmWA/lItDdvwB3ehyVGSd0XKtnEG133k6/BzzrwTZPfpLgYqLgCPHsmLwiAHAQ== 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=jk/EnXNq8TVXrRb0sTQG0CddlJfAlRmO/KLh7JJFhCg=; b=d3+boxmhmb/X8Bh0PKxIHxvySXYKqneWDpX49+ZN8IMxIoxXuWI0R/BlQrp4HcwqrEV6l1j7pxyuFgueLenBFxAeO5a0uGG12yR3dyOom17VGPLUJHqhKIJdqLRapkno3Lv6k7nh+O3LPHXZsOgEta5J+87q/fuT8UO5837CmeWGE0y0WJ5Uh5T9qIelHnCw4zeW5ggSa3xRvcv1gV6k4vX9ucpi3/GEshG0EhSxGcIGAMWwSRgpJ9fvsK40JOcAiZp1NNbyvDn0lOtUNYsuGxKEZIuH639uEf4ak0uXpZajC3aFFhkfGt+rmy8BScEuUvm9kTp/i8nfbG1KD8FBDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; 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=jk/EnXNq8TVXrRb0sTQG0CddlJfAlRmO/KLh7JJFhCg=; b=cXBeKJeNVynorNtliKi4bbecTUS63wpjhJpVZIncBUD/+pLDDYJHIDOEBPKwY+TAG+beuacSt5NQrvCMowOSsvUP1qEbGuwwdyyYmLV5k0CHzJ+KZrCRrwl//bDyCapxas/8moRrsXHwXMzoNnKU/paimNr62P4C9mNKKVuUvZY= 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 AM6PR0402MB3703.eurprd04.prod.outlook.com (2603:10a6:209:19::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.20; Mon, 20 Dec 2021 10:27:51 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::71ab:27ce:856d:5aac]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::71ab:27ce:856d:5aac%4]) with mapi id 15.20.4801.020; Mon, 20 Dec 2021 10:27:51 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Hemant Agrawal , stable@dpdk.org Subject: [PATCH 7/8] crypto/dpaa2: fix to check next type for auth or cipher Date: Mon, 20 Dec 2021 15:57:09 +0530 Message-Id: <20211220102710.3083370-7-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211220102710.3083370-1-g.singh@nxp.com> References: <20211220102710.3083370-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0205.apcprd06.prod.outlook.com (2603:1096:4:68::13) 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: 5984c525-b3d6-4365-8222-08d9c3a36042 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3703: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: AdHH20WPLRMe5G2edSc5yAzwL6X/aXC3eA0kJsyPF/SVPGLrPGAAdsufS+xxdkwImzK/GUdqdzCfZHlLjv+w/GRiyR8TAl64PMPYUFeUPbqMc4NlQdREweU1gwQ7FEopU1LN2PEqTSbaBERn15QOym/C26uPZZxR4o7OnCIX2EwtNEX0GTaDvQzixp0/3qDYaHbzXUlW5iS9+I3SzEomZZIyFlIracnslyhiQUGl4cWSkkgcNtivO0gYQBvUFKHyLfCaj21A3Nz80YjfZB9YLRuKmrrnAlkL5HZSqkIx9fUfMPgDqXx9eKjwwqw8hFFJdu7NshQ1BTpUUuXKdjMhcmI9btjbWgpdM9FuTb6RhUETwiaEGIcBHGDf+55e/8IRFIiuR7J713P7iuRdltU6L/ugHJ3PYBPYxKPpk7k39j2OgNWx2re/UrpwHuta2MHSd/KxoDY0N6w1ThhblKJm1zkkbd3pLdjJPxMVRzPqRpYgzqOh25KW+DOwLfDONQo5VezlBFYR7Udd3gH3pmdu1Xk+KgojMz+Dkkew1lv5zVrmuAKAJn3Ljt0nnMo9j5LheGlX3z+VKz5p3+Lw2ldFFkDkgtSm5xbCzvpNMdjWmacyW/OzXharteZa6EEQxF9RZFsC787G9AMemOCEI612IUfaFnUm8b1JNrhSFV40frj5fqgDGrCd4Nuaki4AlX8J 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:(4636009)(366004)(83380400001)(5660300002)(38350700002)(8676002)(6666004)(38100700002)(316002)(55236004)(66556008)(186003)(66476007)(66946007)(2906002)(52116002)(26005)(6506007)(8936002)(86362001)(4326008)(6486002)(1076003)(2616005)(6512007)(508600001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?t+FW/Gt3sqUqhaYJ6taE85AghUoEjP6h28lPIyhrY2wD261KE13PlnAmarKB?= =?us-ascii?Q?lp5fK3LAGSF9jK7cmj/vHtUhbKxLVePP0XMujJ9OYjyEyJ8VJvRwry9ccjQ2?= =?us-ascii?Q?usxaWZ2K9GFwumc6BfSSRTSQiwdU7sK/5Vt5lNStLocGw5K+bJzh2Bk19Pf0?= =?us-ascii?Q?LjV8wbrcfKddLejR2PWXSwJtGf1JjCTa6gkXisliYnHAcKHj05iHARIKUqiw?= =?us-ascii?Q?gQHzwgWomWx91AN46NoBQ0oxQfW/kTJv11u5SaL8Zhvua3d8snQojz5APtat?= =?us-ascii?Q?BJJxuCJOGLsoaz6UHpFmYYbjS1zGd5VJ4krgUK15I+y/m/4Q0Hvy33q7uMH+?= =?us-ascii?Q?/ToMBhNv94rIuv4/I9DKxkNse+DiMv8TvRugso0ABgKTKPvqufhtpcGIy2qJ?= =?us-ascii?Q?SN/i3eY/CMwVa4wjXozGtTsu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ascii?Q?jwZHtjzTcpJIx/caPnwpEqCGkpx8gctVbIiTA4hZ9G9yGT7zFYp+u+2lNgUT?= =?us-ascii?Q?xftonnKrAneMU3IxIaN0dMT/yncdwWXf6f8O5q28QvMgRmmwDHAFftjrxgKB?= =?us-ascii?Q?MguDcdelrilufFP15pnqYLae6HLOuUrMMuzuMZWMtYhvxKPrH0y+/CSVMUnP?= =?us-ascii?Q?MRzfSnx3NakGB2UEMHQq2srEhaG1BrAxtURvUuu9QVgwei9PswHy1zGEFaAf?= =?us-ascii?Q?PoYn+ux4471mLx5bBKE=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5984c525-b3d6-4365-8222-08d9c3a36042 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2021 10:27:51.4816 (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: 3z9Ox1j0CNQH77OGjlXE6YSElNhsn8d/sD1fosrEgFDwF4sSoCPq9n8+efQ2Fu1Z X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3703 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 b1ad66d2cb..d3d5e9eae5 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3404,13 +3404,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