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 B61D9A0093; Fri, 22 Apr 2022 05:52:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F4574282B; Fri, 22 Apr 2022 05:51:55 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20062.outbound.protection.outlook.com [40.107.2.62]) by mails.dpdk.org (Postfix) with ESMTP id 97BF24281D; Fri, 22 Apr 2022 05:51:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BYRRRHBkdkPAnQTT6XWc1u1hVYfef6F4/r1Jree6lg80Hvibt97w0LtgX7Fo8Lc+BGDtO7irlK/TWSroHkksJNN4GC3P5DUM/xnh7TyKnd1FL+KfeGTrmYc3lo1bh6Hmu0iceushijdMS5QtapoVHsJ9y29UQXQEr931kOSnAnuxoP6aBSZDZ8NhUQ3FdxZGsS9RuaJiPoiJgJCgDtTmSJFCaHxSKTdWWWWbjunhZMz+gHFEJXoyEeq38H9tIscvaIYVOwAo07odWnws9tQoWFc0H1AGJOpB9YMUk5SsjC3ZV+oSLzG6ExPlMCiI1AUvL99z0iv84NtME8sZjXfAbg== 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=Dz//mqu7oLsKSg/JuFhgLjf7kXvq96wFh1dYJERsBfQ=; b=GdYlhgdfSI1ifn2u5vbJ4JDb7Lm/CGFU2JAhGfrN0nDwJ/uGsgdQRVBJfkXndTUA+Nf9awlkO554WR2AsEW0sMtFqvFeKbzw4IZ9+hcW6iuHf3qGCfDb+95iahYUYUuBb57xgxdMQFSmdm7XRu1d29m4rG0LiPUXP5LEsKK5wxOZthNV2viaFCjSAAZTLxP1YVhWBLMsSSdgQiSiBpK0n0aWb/cbJOdOJQh5FoYs5Hn23VUyr4qxATS0eL4Dyay7DaBirLZnxEquzpuhwJiEhYCXQOtPTGmrVwyl1CmHMZPsiLxqhT/Bww+JifaYtzH0KnS0HllNDrFdZDlEzmPQzw== 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=Dz//mqu7oLsKSg/JuFhgLjf7kXvq96wFh1dYJERsBfQ=; b=BWjRONWosC+xjFGjVI2V2c3yUuX/fxxDd6AqF5iLvGE/fy5b+TCFXT/Y/Cqz01/LMhBQDKDfeqg9sUZL0MxtzrIFJDiAOGmAvhI4lmGVNT/wJti3CGNMoWm5nbT35SRzK1hnvxCQT4SD21Wjizf273APUAXQQRgqaqI17NhDJm8= 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 DB7PR04MB4393.eurprd04.prod.outlook.com (2603:10a6:5:32::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Fri, 22 Apr 2022 03:51:51 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2%7]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 03:51:51 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Gagandeep Singh , stable@dpdk.org Subject: [PATCH 10/14] crypto/dpaa2_sec: fix crypto op pointer for atomic and ordered queues Date: Fri, 22 Apr 2022 09:20:56 +0530 Message-Id: <20220422035100.3180870-10-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220422035100.3180870-1-g.singh@nxp.com> References: <20220422035100.3180870-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) 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: 21a0cd7d-0519-42b1-4759-08da24136f23 X-MS-TrafficTypeDiagnostic: DB7PR04MB4393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cF++kN0FhLW+JYHmKQBFBB1rchyR84a7674P99z/AyLYAe1UEFnc5cPxX50W8Pn+AZwtUPrt5bAtmEkf/FLJe9mz7jWCzb/W7km8EkQexZCH3jVhwgK0P8LJraaABsgKFHcbCu2LCkendJlzPeDPjXADzhCY2XZUMtscyREdLyPrG2S4lBKuZ4cPeyZaPloyenMqU/z0/Nu19zDZWH7BiT/XOgd5yqOp9EZIV2TKnHF2K7K/TW6hDZT4M+A/T28DE1sWtQqGm6PfNDek1YCi74GE3QEQjJNhby3u7vt7nQwMXYqoA++KCICXpjMeGjWH+zoQ74bRDANVxgCc5o+rv3Km9TCL+FeCHVnYJvQMJOLz+z7C6wfLLKKPD/tJxbHZSSw15l1hbKiE0Gcqq7HtcpG3nuAwyFS1VgB3D1D24XUgCEq2nJcpCE+ulz1giWRNEck4UExWF1SN+wvvkl09OHjh3Ws4DthpleRCXyU/hWJnUYrWkoPQ3RCrXknGczfgl278fk4QK/Vat4EqWD1eizaNgBFFOGUNvc9yaRwxFg8Ue+xoR/dOSv6tY589Y6DnuI3/V18Hl46gauqC577OnoNh7xUrDBPaOuq4YyP5goUsULiFLkP+qVGqeHzSDsXzhIJvzy2vjbE1GkVTWFk5RH3/J3UcgL3VDiI0PBbkpoMKkuUks+uv/xpirmPOyVSvA2rLN4sbspzMGXGgQQui7A== 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)(5660300002)(36756003)(2616005)(6486002)(1076003)(8936002)(86362001)(316002)(52116002)(66946007)(26005)(6506007)(6512007)(186003)(66556008)(66476007)(83380400001)(38350700002)(38100700002)(508600001)(4326008)(55236004)(2906002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?TlS9wHK+vC2ydte9TtnMO4lGcbwrXZLTfU+7vKpdNP4/uOspnsRmRUE3pOxX?= =?us-ascii?Q?mXN7dX4QnSvNGJlyI7tIPU/WrS3979noDOhWDAzQhhD2xg7mmG8iFwwyx/ZS?= =?us-ascii?Q?+Kznlyn6H58Iye3O+sq1ZnO233sQ8rJz+8syqaRdpLFTgd2So1FffsNZRXRD?= =?us-ascii?Q?5YNdzX6CfSQqjNBFIOZq/Meldu1s3fsUu/LEKj4XRlPPdaXQi8hu0SJI1lbQ?= =?us-ascii?Q?0eFSbaovVzvsxdmKNNjR9eto+PItXJmtDMu7lqHzyq2OAtaTahClpWMdcKPD?= =?us-ascii?Q?Ey2De6xHwdRX9BF8Q6Q7Iw7exCc3Z6/8tgQ/9oDxoeV9SYKHTphkWEv9bxMb?= =?us-ascii?Q?OYDZ32+FlUyDn0gLNvtewUMe6MHedcnTub/dTdizRY1zlT4pm53bfGGo4ALl?= =?us-ascii?Q?/DTt5C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UV6?= =?us-ascii?Q?V5i0K/QvNolpmtifbP9yzH6PvGf4CbohnBQTXh5wS0cQ+J30NFrraL/dh9QZ?= =?us-ascii?Q?md6VzrlNYe2pkFWJB5/FyJcrUH8RhkOQnD2LA1Af7igYN9INTYBL17uAiG09?= =?us-ascii?Q?PKxVgkkoEhvCkYQ7teZAiOzGrAbL9iXOLBl03wZDiYjevlA6x8nsQri6Mvh5?= =?us-ascii?Q?0UUnzik8aHLN5vJrdlCYHXukutvsEfe1nSl24/+18e6DIHosf4KZGG73YH3s?= =?us-ascii?Q?gMd3SYVuZExLXWHSZe/YHcAaNShdFcizD1nkHyhRvu4z6Ig/pfMyZzPdn8gt?= =?us-ascii?Q?/XmuBJL4lifpsGWBQLPSP/TIPGXYgJzUla2DiNieMviz5wwExgxyeIGOkPut?= =?us-ascii?Q?mQV5av6RyEJVeQm49eC2vRiX2sUCtKO7gHq6HMvu1z3K1szZnaA7dd3UICq3?= =?us-ascii?Q?PXaYQDRnfg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21a0cd7d-0519-42b1-4759-08da24136f23 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 03:51:51.6407 (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: WFpSCpKShL6iKqjaWoCGGLxl7zapf97vMbT1iX0F6sfbGkj7wHiTd8jJxzhbG0bl X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4393 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 Driver is filling the crypto_op variable with an invalid value which can results into segmentation fault. This patch assigning the correct crypto_op and event buffer pointers by extracting from FD. Fixes: a77db24643b7 ("crypto/dpaa2_sec: support atomic queues") Fixes: 4562de326d30 ("crypto/dpaa2_sec: support ordered queue") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 86c8df241b..9f2b384af9 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -4019,7 +4019,7 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused, { uint8_t dqrr_index; struct dpaa2_sec_qp *qp; - struct rte_crypto_op *crypto_op = (struct rte_crypto_op *)ev->event_ptr; + struct rte_crypto_op *crypto_op; /* Prefetching mbuf */ rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(fd)- rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size)); @@ -4036,12 +4036,13 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused, ev->queue_id = rxq->ev.queue_id; ev->priority = rxq->ev.priority; - ev->event_ptr = sec_fd_to_mbuf(fd, qp); + crypto_op = sec_fd_to_mbuf(fd, qp); dqrr_index = qbman_get_dqrr_idx(dq); *dpaa2_seqn(crypto_op->sym->m_src) = QBMAN_ENQUEUE_FLAG_DCA | dqrr_index; DPAA2_PER_LCORE_DQRR_SIZE++; DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index; DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = crypto_op->sym->m_src; + ev->event_ptr = crypto_op; } static void __rte_hot @@ -4051,7 +4052,7 @@ dpaa2_sec_process_ordered_event(struct qbman_swp *swp, struct dpaa2_queue *rxq, struct rte_event *ev) { - struct rte_crypto_op *crypto_op = (struct rte_crypto_op *)ev->event_ptr; + struct rte_crypto_op *crypto_op; struct dpaa2_sec_qp *qp; /* Prefetching mbuf */ @@ -4069,7 +4070,7 @@ dpaa2_sec_process_ordered_event(struct qbman_swp *swp, ev->sched_type = rxq->ev.sched_type; ev->queue_id = rxq->ev.queue_id; ev->priority = rxq->ev.priority; - ev->event_ptr = sec_fd_to_mbuf(fd, qp); + crypto_op = sec_fd_to_mbuf(fd, qp); *dpaa2_seqn(crypto_op->sym->m_src) = DPAA2_ENQUEUE_FLAG_ORP; *dpaa2_seqn(crypto_op->sym->m_src) |= qbman_result_DQ_odpid(dq) << @@ -4078,6 +4079,7 @@ dpaa2_sec_process_ordered_event(struct qbman_swp *swp, DPAA2_EQCR_SEQNUM_SHIFT; qbman_swp_dqrr_consume(swp, dq); + ev->event_ptr = crypto_op; } int -- 2.25.1