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 18537A034F for ; Wed, 10 Nov 2021 07:58:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 091BC40142; Wed, 10 Nov 2021 07:58:05 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2047.outbound.protection.outlook.com [40.107.96.47]) by mails.dpdk.org (Postfix) with ESMTP id F370340142 for ; Wed, 10 Nov 2021 07:58:03 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gzg20XFxmxuJeMnGYaXznV9du/TV4yiAsy0054IlToCDFlX/8ig7b/h+SC8nbhAMvj6opjWPPhacZDVmgKZxHNoe543n5bc+X+wsHCiYxzXkgTTUElR7kYk4oI42j1lnxi/QaQXEslRH5lRekuVCflynSaX7hQifc0MFTgTuTjjMEsWj02BrWR3x8EOz1+xwFiEHYBTleYGHUleE+zBkhWF6W0lacTWiLaSwyYgSDFT2q98zp63NrAQXhCdhPKxY7pVDlkuK84b7Uv8YHHSs7kcC+4gF0ihFy4SM/iV0gU3LfR499b+aCcZXaXlmIcPVzZPt7e3781m1aN7i9Zmdpg== 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=YP1BBHrrrnhdy3iJGRPp8CcRr2fJNPo/FfHyNvffRXY=; b=nSTlEs068/WiQppGmrndasekxndruWy5HyGdOptRJxUDseOJywLp2G5W6+l5UJ/HRcybGhJAALJYF1vz2WZ2ZrQ4yHOUUwV1hZErvx4gHMvUitp0Azye8N0eJmM3MC5LtAKUgpgjNqItca64sAzr3UOSBpolpMrYtJkcAHdRd2DkjHPqZVlTUf5PXoNvVhxsYbSRH7DyGvKWEmzu7qbnJ3pNqn429eAwz14VINdW0/AxuunT75KhRPdUCe6/lqxxltRiAvyf2Bw2irYIhwdx7idNpIrgitfQrGP06uu/pCXLq1KD/Q0RcnnU0mFNX6B+T1Wc6y+9Q95CA7uXortWIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none 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=YP1BBHrrrnhdy3iJGRPp8CcRr2fJNPo/FfHyNvffRXY=; b=EyBNL7qsg+diOH7PEnVOQ8brOQKQ89OiTnSN1QZKUokTuyq9jISIumD6hDrHVRO7sUSClf7Y/jeF+cQ0fH/0Jcz72T9LUKVYtiEOUQQX7UN3o98AxpT7v0kDt/t931tm4ghS6y51uprhlC4wAK2YSf2o3pqoBt82yVyuKUW2dxFhiWk6KJhtSrWRCfN9SORuU5hJLyzDJpyqjhqGpftJ/yBqZbw/UXjWsWPcl8W2OltMpiMBelnVfagQxvhFjwb7f8GqVTv8GNOQGjBnAza2botvGhizYzQFPjOmnvOdrjBudMaHyuVLAXuXn5ETSHEFZ6rkQe2RRC3iqs8kJYJC4A== Received: from DM6PR21CA0017.namprd21.prod.outlook.com (2603:10b6:5:174::27) by CH2PR12MB4921.namprd12.prod.outlook.com (2603:10b6:610:62::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:58:02 +0000 Received: from DM6NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:5:174:cafe::55) by DM6PR21CA0017.outlook.office365.com (2603:10b6:5:174::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.2 via Frontend Transport; Wed, 10 Nov 2021 06:58:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT005.mail.protection.outlook.com (10.13.172.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:58:01 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:57:59 +0000 From: Xueming Li To: Arek Kusztal CC: Luca Boccassi , Fan Zhang , dpdk stable Date: Wed, 10 Nov 2021 14:31:54 +0800 Message-ID: <20211110063216.2744012-231-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2eb06fbb-af42-43b5-a4fc-08d9a4177000 X-MS-TrafficTypeDiagnostic: CH2PR12MB4921: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WnoZU6iZoPOkK3HDASEkoCv8izHdMMNafddtmisiXgn/KJwXVq2OmBZ3gvcB7r8V3UnAgYGdD3wQDmQR/jNgws3YrOW25QZRh8wKfGH2h/KBdNKYAxZKI8r2gLUVP6QHsO3JtVOdoC4TjfH2JqqpWmMkuwRaKnLyy7tLdr4934IzLuQNlF04Uy2IanLUFnu695OHi3cf7oJgpW/GbMeNEaMV/spDII6soGM3Q+whvtrtYZrrl7Y8JmM4/mvLMxAUS0pWyOX0ezsX/9PpJr8Fq2hAYSCI1uaJOAf5yK8QuMluZcfQ+Xc1uJ6oX+zWIokuCrD+lNugiGuzdKDvJah1U0A+ZDUlFxOxkx1O/ObDCxh5L6c+0DUOVSRziXIAadkP+fPLvp3YsO8WXwyoNejBNnc+7D/9vbIBmTluQR3r+IisFSDP4TevFFw2aE2px1pI0lcUMNrj3/kBZMQwFPRCyN2dXDySc6a99w3IcATSE8DHtiorCFOFZ9GwNXSccAsrPlMTPOb46owMNlUtf4Yc/ftggJACxcX6aAef9OiFRduJeMM9CpUodcFBbPp4H7nwuHGuGixmI+tZJ+zD4YUIsP4NA8qOaxLxNqA6JO62uOJ0hSekx4bkgT25s21iDFrll8f/g4gDNsFX++w5v4wURnTe5XWG+RFntxYn/G0i8XdU5u/DogSA0b4lPgFObKNCl7ILGZjjfgZ4tYJjhO/iXvLTStY6x+KKMdlDSshj3mS9UtqXkGjntsyUzknfGTvchuwR/YJbdgePMtSXzvIvfJRSFc00s5wjlSO8YtlH+iy1oRfqx+WSrC1qUOrx0p+EFCojeksFjCOkzsK7oaJxrg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(316002)(36906005)(82310400003)(6916009)(83380400001)(7696005)(55016002)(356005)(47076005)(70206006)(966005)(4326008)(8936002)(70586007)(36860700001)(508600001)(1076003)(8676002)(53546011)(86362001)(336012)(2616005)(6286002)(2906002)(4001150100001)(36756003)(426003)(6666004)(186003)(26005)(5660300002)(16526019)(54906003)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:58:01.8849 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2eb06fbb-af42-43b5-a4fc-08d9a4177000 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4921 Subject: [dpdk-stable] patch 'crypto/qat: fix uncleared cookies after operation' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/7982968fd4ffb1a32ca4e90a8f7c8fc10226a930 Thanks. Xueming Li --- >From 7982968fd4ffb1a32ca4e90a8f7c8fc10226a930 Mon Sep 17 00:00:00 2001 From: Arek Kusztal Date: Thu, 21 Oct 2021 11:06:01 +0100 Subject: [PATCH] crypto/qat: fix uncleared cookies after operation Cc: Xueming Li [ upstream commit 867ba300f915291629c33b2eadf6a98564c622a0 ] This commit fixes uncleared cookies issue when using RSA algorithm. Fixes: e2c5f4ea994c ("crypto/qat: support RSA in asym") Signed-off-by: Arek Kusztal Acked-by: Fan Zhang --- drivers/crypto/qat/qat_asym.c | 41 +++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c index 983c639d68..f893508030 100644 --- a/drivers/crypto/qat/qat_asym.c +++ b/drivers/crypto/qat/qat_asym.c @@ -65,27 +65,45 @@ static size_t max_of(int n, ...) } static void qat_clear_arrays(struct qat_asym_op_cookie *cookie, - int in_count, int out_count, int in_size, int out_size) + int in_count, int out_count, int alg_size) { int i; for (i = 0; i < in_count; i++) - memset(cookie->input_array[i], 0x0, in_size); + memset(cookie->input_array[i], 0x0, alg_size); for (i = 0; i < out_count; i++) - memset(cookie->output_array[i], 0x0, out_size); + memset(cookie->output_array[i], 0x0, alg_size); +} + +static void qat_clear_arrays_crt(struct qat_asym_op_cookie *cookie, + int alg_size) +{ + int i; + + memset(cookie->input_array[0], 0x0, alg_size); + for (i = 1; i < QAT_ASYM_RSA_QT_NUM_IN_PARAMS; i++) + memset(cookie->input_array[i], 0x0, alg_size / 2); + for (i = 0; i < QAT_ASYM_RSA_NUM_OUT_PARAMS; i++) + memset(cookie->output_array[i], 0x0, alg_size); } static void qat_clear_arrays_by_alg(struct qat_asym_op_cookie *cookie, - enum rte_crypto_asym_xform_type alg, int in_size, int out_size) + struct rte_crypto_asym_xform *xform, int alg_size) { - if (alg == RTE_CRYPTO_ASYM_XFORM_MODEX) + if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODEX) qat_clear_arrays(cookie, QAT_ASYM_MODEXP_NUM_IN_PARAMS, - QAT_ASYM_MODEXP_NUM_OUT_PARAMS, in_size, - out_size); - else if (alg == RTE_CRYPTO_ASYM_XFORM_MODINV) + QAT_ASYM_MODEXP_NUM_OUT_PARAMS, alg_size); + else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODINV) qat_clear_arrays(cookie, QAT_ASYM_MODINV_NUM_IN_PARAMS, - QAT_ASYM_MODINV_NUM_OUT_PARAMS, in_size, - out_size); + QAT_ASYM_MODINV_NUM_OUT_PARAMS, alg_size); + else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_RSA) { + if (xform->rsa.key_type == RTE_RSA_KET_TYPE_QT) + qat_clear_arrays_crt(cookie, alg_size); + else { + qat_clear_arrays(cookie, QAT_ASYM_RSA_NUM_IN_PARAMS, + QAT_ASYM_RSA_NUM_OUT_PARAMS, alg_size); + } + } } static int qat_asym_check_nonzero(rte_crypto_param n) @@ -657,8 +675,7 @@ static void qat_asym_collect_response(struct rte_crypto_op *rx_op, } } } - qat_clear_arrays_by_alg(cookie, xform->xform_type, alg_size_in_bytes, - alg_size_in_bytes); + qat_clear_arrays_by_alg(cookie, xform, alg_size_in_bytes); } void -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:12.045415529 +0800 +++ 0230-crypto-qat-fix-uncleared-cookies-after-operation.patch 2021-11-10 14:17:02.060744536 +0800 @@ -1 +1 @@ -From 867ba300f915291629c33b2eadf6a98564c622a0 Mon Sep 17 00:00:00 2001 +From 7982968fd4ffb1a32ca4e90a8f7c8fc10226a930 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 867ba300f915291629c33b2eadf6a98564c622a0 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org