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 C3CDBA0093 for ; Thu, 21 Apr 2022 14:01:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF68140040; Thu, 21 Apr 2022 14:01:18 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2089.outbound.protection.outlook.com [40.107.20.89]) by mails.dpdk.org (Postfix) with ESMTP id E418A40040 for ; Thu, 21 Apr 2022 14:01:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IAFJPk07ZlV9q1FAa+40KJBt0pHv0Gi4mAK3mVxutZl7R6DCtNLQkeH4INnORNjSwd8/sVwjEhdPYziDHhLNNTkYHpqQ32ZcZ246wXNS+nUfy+KpCemoVA++QKklhFgrcgtu6HjdLDstcavKuX5Gili7hyfxTzDZB4mIzbTcOzC9SAlMmUfOezgBQlItRd+20R0bA5Q+R+06Kms2W+687hoUEhrzXsZyi9C5j21q07fhjEDilPb90OiG5yQJ39XjBdJicw9p8fWhxWyVFdhpuvKOQPwbz87E1CczYAyhjP025/3lc54aVk2NW2QoO6sUs26LC4yRVMxXJqprJxsjeQ== 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=zb8hRojx1Y81I0GxDY1iUEdt7LihT0SzchJjZa0YaPQ=; b=dwm5eqXW5zxIh9Vo+ota0sptbdaJOnOhQ+JQp0tvChSi0eMBgPfTUGBvindo8fYfLBocdZGvWzMAIP+Lr9LqBpvvekNjqfEctNvxQk1XdZR4Qz6ggXNhuERg4V13Q6sBUypaTYNSg7gWlnFSS7YmtkAV+Z4L4fn16PDuoOn+aLyhZcJv+JveaO2D2U219tHszKGYjdlayUxxhFlnlvZDsINL80qn+aF5k4RZnbbph7G2cJGefpM3k3t+Zl6ir95qMqCimYjeLsVqwFOZ9dxudGx3vvu7vHNqPz3lwpvSedLpaa46qOEeEHluXKVOtUvG7b8TjC6xrhaNKDFHdRKONQ== 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=zb8hRojx1Y81I0GxDY1iUEdt7LihT0SzchJjZa0YaPQ=; b=R5lW7rNRx2+Renwkug+ILZ8Hw9BeZ6B8hQ6FRpzKlFLhpYjPMcUdW5b6fdnYNtzVszYr4OalvIUcxMPDedhT8T3JgZ8sdR+cd1ytEBqa6FW8NYRSR3NLaWnTka7T+YnyNk4OdKHhH7ABVOi565A02VTendr2fC+3rg/FlBGCEi8= 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 AS8PR04MB7816.eurprd04.prod.outlook.com (2603:10a6:20b:2a3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Thu, 21 Apr 2022 12:01:17 +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.014; Thu, 21 Apr 2022 12:01:16 +0000 From: Gagandeep Singh To: dpdk-up@NXP1.onmicrosoft.com Cc: Akhil Goyal , stable@dpdk.org, Gagandeep Singh Subject: [PATCH 11/15] crypto/dpaa2_sec: fix crypto op pointer for atomic and ordered queues Date: Thu, 21 Apr 2022 17:30:39 +0530 Message-Id: <20220421120043.2565227-11-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421120043.2565227-1-g.singh@nxp.com> References: <20220421120043.2565227-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR04CA0167.apcprd04.prod.outlook.com (2603:1096:4::29) 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: 9c1273d9-3602-4908-4cff-08da238ea3b4 X-MS-TrafficTypeDiagnostic: AS8PR04MB7816: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: Ea4vd9DgXYYof+BAHEr31t4dMFKs+lwlhCdUT8eldbdle/fCcGPocbaaBsaY//5njDs4vm2hUMSbU6IL+6SsIeyhk1dxKsn4cnIc8IxqYR35MyDEvKuxuvKmkeH+BB909dA+NCKK9WD9ic0uGZ+X3+ZM2Ao4GHtxoyZBA13csuCv/hQ2zDU19RW21EU3ugHEClGDk9OWQZmc2emrrOBBAg5Ua6RR+AYu4PJFI/YDubQP3LtDSbukJiXq8sqVEp1g3vsUCJ5BDetmk4fjGD+gFmS1s8N+olKkONv0d6m0KyovUQDWoDzHwyqyvdjKocp8IuS17KB3EXf5MvdHnTyDjPLXi+txKQEX9ND6bWV1IyXeY+I0k+Uhm3Rei3TWTYVBM4OxImuuH5gVzL8wutdA1cH2Cjyk/HfAlmqBfHoapv/7/9XQdX+xgBJo1jjx+InMt0goB5bCkcLGPPoZaUTIJ79HwYEzearms6a/ITZ0ICpKlsKC270lRuiZLbx5a2KIFWrerZ5jpycuvpemYkCaASIGrNMrY8vzmYNf6EAXvGhE9YU2oX21xjnFivXZHYWwH5GAsaqWM8jBF3aBPVhXbEoiy5sXC0JNy0JNKUUQDhN/HG/D1kcxa0aTDuojl9gqS5nn8K0bG0fBXwjL+JuT0twGxKlJ4Fq++AkiayqUtiyBYxfc0deIETsskruuRjahPcGt2/2tqSUAx1xBH+OA+w== 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)(26005)(2616005)(2906002)(186003)(1076003)(66556008)(66476007)(38100700002)(6486002)(86362001)(34206002)(83380400001)(66946007)(4326008)(38350700002)(52116002)(8936002)(316002)(36756003)(6666004)(54906003)(5660300002)(6512007)(8676002)(55236004)(6506007)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nzLE/7l9OXAS8ZKVC2SReZD1v3U1lKYBWt4J165H1yDVfCybj+uF7O8JDHM9?= =?us-ascii?Q?/0kp6QQxXJhE7EtjOnPDqSj7cBGISyIkUZ2O7Noto+CMl7QYIXNS/WL8xe3B?= =?us-ascii?Q?b9mVe1T39qBXZ9gCbCJnfNJJWWSj2Gk4ughqwzloZiql/HsoSWIiF1+DXV0I?= =?us-ascii?Q?VGysPpW15XX7gk13fFzaHHWw32RRuXPGPAnPEQKzMEORvjilLZYkWebxWd8q?= =?us-ascii?Q?okkd1Lb4yX5yVrvcRNlNnseDShKrz61G4RM1LzqdHgyrl1LksXdWE95xu2R3?= =?us-ascii?Q?PJNxHhlZK7O7kBpaqiBVwk+d28iFzJ3FJEGdc+nh+AS7Lp5V8Ko2hSS5Hbxc?= =?us-ascii?Q?KRi7GiliiK629HHRAJ+gyjH06Rc8uOxWaEYi/KgwGLSc9MslFl3VBuP+0eyj?= =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hlO+IE0mDVqccGaJ3TrTcshLmRBjYNIHv?= =?us-ascii?Q?uIwISRnOZbX5GK0Q3HU9xuPhNDErUnE8XjaRh/7B5o8pIZub37TaoKJMNEr4?= =?us-ascii?Q?M5jSgftJRURwm9kQqIQAyVSakrZawUo7WdmrVW4hjS467z4hpaTA28PjYE44?= =?us-ascii?Q?LCsGNxzqJy89Z/4/OtwtzHuN8z+2G0tKFUX5ngQzYgDxpxRcNrTpxznqNsTP?= =?us-ascii?Q?uhxuJZgtSOiYSPa4zmJkGwg0S7j64JzniUBkPj+hRw29zCwGLgqh/RU4RJAf?= =?us-ascii?Q?bjzqaChiigWyfJv+GqToI7kUG9YggHHRybf+X/uy2rxLUoN/qtKPcKVZfi8A?= =?us-ascii?Q?wJONaQE4EF66h3yoOpXAl91TlhlTLG2b9IyL8i3LegbquD7TLQGxPKyl+QfC?= =?us-ascii?Q?uPlzHyAQ70XuFVpiYgz26RVGBTl04RpDWAbjqgI5cLnyIpdpTx0YBJ9ab9Xo?= =?us-ascii?Q?HBkvSl2Veg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c1273d9-3602-4908-4cff-08da238ea3b4 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2022 12:01:16.8613 (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: ZiG530QFKaqEHXzdajwSId4pXlUD6TXiW7b0kKb4g38TOHdRc4Fk8+RRXbpo8bS6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7816 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 From: Akhil Goyal 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: Akhil Goyal 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