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 6FFD345E41 for ; Sat, 7 Dec 2024 09:05:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61BA940281; Sat, 7 Dec 2024 09:05:44 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) by mails.dpdk.org (Postfix) with ESMTP id D776C40281 for ; Sat, 7 Dec 2024 09:05:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O4JAVxj6DQdPKOCRyLZXhYj56TbP+kthtBD9+yrng36rq0SceGXQfmg0oJ2FwSh70H+zz3aA7jkk7+xu0QbAXbhhWuR8QipScQ7Di9L8T2pCtNgd/nTplKf0HtgrPenY470plM7jBPLmsvk6TUTFJzt2TMvXVm/2ZsYTX9w7NVnMLEwjHUfqkOOJQd7Ysdvf5kurrFPheD1MiZTBqmXjc+mao3HMq8/VE0mfVG/JCosyHgL499SC2OBmbWKC8+dMJSYivK8FzLMIUYKiGcUFAWuWLXMXQ7tPuICRTwRt81FugpnW6h4l6h7Eze4cbiS/NxKSyl8xM5tNwmkeAcAXaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=uzgwb7rqjmKHV4jE0pSSNq2N29jKQpjVud+XFtAqUIo=; b=jpsqN3eXzi06JLEz+xtZz42J/r5aWviSCDZrakK2QUc0zncE85bzoMbdL2VJbUM8gY5qi1RSGhnYHgWYehms44u5T3M1r/laav4xxDFXnJQ1gpkY5GQmsykggKqCBKJAgXeivkjv+iiv12ndUFPjP+cIgG5DfyQMkOLg0Nf2NX1dt0IQ41pdHqy8ahVy20+k6SWCbrUA04DV92TFNshIKqChl/1BfmimvgPqgSv4YgozyAl4fmSpZnRcOJN1c1NT65deutf+hHtZPWGKq9DjZ9BjMV48zBtiUhf0+cXfYS1FpUfWHnMq0xwaQvnAkLePrse4mynFihpTW7asvQC7aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uzgwb7rqjmKHV4jE0pSSNq2N29jKQpjVud+XFtAqUIo=; b=FTJOUT5znm0r/fFcyyEVxlXnMaylJpnOooUazq6JZtm5wT3Ovt6P2IF4gWirYlhQWwu4T+2wPfMIC1BP9uNBb0z2upEISyu/ozBpDxS7QE0+IKYzVOvqp9iIRXRbgnZ13fBAJPDNjMauRCPPXuRQ5YsK9Kx2vbgE/okSM02Fbg+2du4AxPVwuZv0QqS3fgacvH4l4qOZpNJBMY4h6yrMO1cxKQAK166D4nj099jZxam7RYMjogA3PQlPk4FDOJ8Fx2DNBJLIH7eWhFEFDSDQeRBVfJXqvWmJDOET8lCxTzYS5NwfGl/zQOQoJHHry8knvFYTIWawAWTnniyXjDVuew== Received: from PH8PR20CA0006.namprd20.prod.outlook.com (2603:10b6:510:23c::11) by DM4PR12MB5745.namprd12.prod.outlook.com (2603:10b6:8:5c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Sat, 7 Dec 2024 08:05:37 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:510:23c:cafe::d8) by PH8PR20CA0006.outlook.office365.com (2603:10b6:510:23c::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Sat, 7 Dec 2024 08:05:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:05:36 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:05:27 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:05:26 -0800 From: Xueming Li To: Arkadiusz Kusztal CC: Xueming Li , dpdk stable Subject: patch 'crypto/qat: fix ECDSA session handling' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:06 +0800 Message-ID: <20241207080055.488538-49-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DA:EE_|DM4PR12MB5745:EE_ X-MS-Office365-Filtering-Correlation-Id: 16d622f2-acb9-4f89-b2bc-08dd1695eea8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?TfbPT+Sjydq+zuPA9Sz1ZisfefhnANbqiIA94+/9qHU7OZSCLTMaM8QPUQKn?= =?us-ascii?Q?xbvsSpXhti1Wu5z4ZZweHl11N9SpSVuhQRD0OJhuQXTY+od50Bgm1oxe0pED?= =?us-ascii?Q?MjLso2KrbdScMK6xAWwG6NLx8rDi1U/1xMHK7P4/98CjFbwLzb5lXg+fcNJv?= =?us-ascii?Q?KB1KSSZEiodhsD/jAb+GYMjTN9c4zRjffz7QjwUWxjXq0kMJxxjqiOiZeVn1?= =?us-ascii?Q?cSLDZBbATGatlioJFc94d/3EXZPj0J+ZtHp6InhE/HEYHzKbflZapQjQEVq/?= =?us-ascii?Q?b7Awc11KEa/E6OUHxJ1rhbf/RLIdDmiZAweQNAlrr3vJF3N+IPRPuy4IeK9f?= =?us-ascii?Q?dq6JLHQKIwJd1lV86YeH+Ut787dFhQDz4jKTA9QLVjiuN7kcrn09V/AFnDuF?= =?us-ascii?Q?wLKkZy/my2fxqqKNmz3ID0jjgmVGA2jEYE58CAEGArRSJKgc0FuSj428Hka7?= =?us-ascii?Q?8IEwNb1PojVE1wCaTymzAVgPomPDJeGvH1g9pwMqupiXSer78ls155KBbweq?= =?us-ascii?Q?8oRGkjhhvEjtpwB2zmFmEGVlWW7WtBjMcFoyjccuPkwBODY4x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KWfkQxLUeLUe6+THE?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:05:36.5356 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 16d622f2-acb9-4f89-b2bc-08dd1695eea8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5745 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 Hi, FYI, your patch has been queued to stable release 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=084a75515686e31358c6052839456d7b6bf2538e Thanks. Xueming Li --- >From 084a75515686e31358c6052839456d7b6bf2538e Mon Sep 17 00:00:00 2001 From: Arkadiusz Kusztal Date: Wed, 6 Nov 2024 15:14:21 +0000 Subject: [PATCH] crypto/qat: fix ECDSA session handling Cc: Xueming Li [ upstream commit 20e633b0ca15539b682539a665e8d3dc0dc2c899 ] Fixed a problem with setting the key in the session in the ECDSA algorithm. Since the key is being initialized in the session for EC, it should be reflected in the PMD session initialization function. Fixes: badc0c6f6d6a ("cryptodev: set private and public keys in EC session") Signed-off-by: Arkadiusz Kusztal --- drivers/crypto/qat/qat_asym.c | 41 +++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c index 38c23b397b..4bc087987f 100644 --- a/drivers/crypto/qat/qat_asym.c +++ b/drivers/crypto/qat/qat_asym.c @@ -1337,11 +1337,48 @@ err: return ret; } -static void +static int session_set_ec(struct qat_asym_session *qat_session, struct rte_crypto_asym_xform *xform) { + uint8_t *pkey = xform->ec.pkey.data; + uint8_t *q_x = xform->ec.q.x.data; + uint8_t *q_y = xform->ec.q.y.data; + + qat_session->xform.ec.pkey.data = + rte_malloc(NULL, xform->ec.pkey.length, 0); + if (qat_session->xform.ec.pkey.length && + qat_session->xform.ec.pkey.data == NULL) + return -ENOMEM; + qat_session->xform.ec.q.x.data = rte_malloc(NULL, + xform->ec.q.x.length, 0); + if (qat_session->xform.ec.q.x.length && + qat_session->xform.ec.q.x.data == NULL) { + rte_free(qat_session->xform.ec.pkey.data); + return -ENOMEM; + } + qat_session->xform.ec.q.y.data = rte_malloc(NULL, + xform->ec.q.y.length, 0); + if (qat_session->xform.ec.q.y.length && + qat_session->xform.ec.q.y.data == NULL) { + rte_free(qat_session->xform.ec.pkey.data); + rte_free(qat_session->xform.ec.q.x.data); + return -ENOMEM; + } + + memcpy(qat_session->xform.ec.pkey.data, pkey, + xform->ec.pkey.length); + qat_session->xform.ec.pkey.length = xform->ec.pkey.length; + memcpy(qat_session->xform.ec.q.x.data, q_x, + xform->ec.q.x.length); + qat_session->xform.ec.q.x.length = xform->ec.q.x.length; + memcpy(qat_session->xform.ec.q.y.data, q_y, + xform->ec.q.y.length); + qat_session->xform.ec.q.y.length = xform->ec.q.y.length; qat_session->xform.ec.curve_id = xform->ec.curve_id; + + return 0; + } int @@ -1375,7 +1412,7 @@ qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused, case RTE_CRYPTO_ASYM_XFORM_ECDSA: case RTE_CRYPTO_ASYM_XFORM_ECPM: case RTE_CRYPTO_ASYM_XFORM_ECDH: - session_set_ec(qat_session, xform); + ret = session_set_ec(qat_session, xform); break; case RTE_CRYPTO_ASYM_XFORM_SM2: break; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:45.699435508 +0800 +++ 0048-crypto-qat-fix-ECDSA-session-handling.patch 2024-12-06 23:26:43.953044828 +0800 @@ -1 +1 @@ -From 20e633b0ca15539b682539a665e8d3dc0dc2c899 Mon Sep 17 00:00:00 2001 +From 084a75515686e31358c6052839456d7b6bf2538e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 20e633b0ca15539b682539a665e8d3dc0dc2c899 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ -index 7bb2f6c1e0..f5b56b2f71 100644 +index 38c23b397b..4bc087987f 100644 @@ -22 +24 @@ -@@ -1348,11 +1348,48 @@ err: +@@ -1337,11 +1337,48 @@ err: @@ -72 +74 @@ -@@ -1388,7 +1425,7 @@ qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused, +@@ -1375,7 +1412,7 @@ qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,