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 BB24F45CE3 for ; Mon, 11 Nov 2024 07:33:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B318E40E1F; Mon, 11 Nov 2024 07:33:41 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2046.outbound.protection.outlook.com [40.107.92.46]) by mails.dpdk.org (Postfix) with ESMTP id 9774440E09 for ; Mon, 11 Nov 2024 07:33:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jRbEa+AZdHy4blcF23u58ObKsRKAlpvV0osYyUm5ECKM48ijPxbrsMyVeur3W+Y9gBNwQ152GWF0O2xW4wylAFpdI4sGMj+sD7R3O1R+dqsDI2VZUzd7HlGVijeQmCMl2EVJUv69cu8AbEmnZMY4VI4PAN4ota1asxYXazVCjT5Yaw52hzuPc81PH97Ee8np30f7CowiJYFg9EavjTrsK/7IC8TDQo9Idc3wA8TmHHJ6blb+EN/fP+I9iilP/7DQC784X9IUCuOC1Q1FWjQ01S2AulcSR7SEcZePSzPcbGoECTQnuGdq2U08xFwZtp08vREOPyiOyQrctXURODORTA== 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=7KR9vqYiqFxqO7gVO6iJr8E86tZZ3waNhSE/d0wRQKg=; b=IZ7vEyro0jDpfmZ9a65M6C2HNS1lF2TnuupNaq9jDwkYUqpfetaDOGfMwUMcgLBBz8HmGCvzfZeyPNxjKeRVicb6Um904VSXeWsG56Isvq9wbnxNnn572VEOc5Wdf9Ioo5CJKgg0F48Q0HDdulesWkP1ToboM14UlqSssgZm4kXCgpn0RyNNwzoBbNFdA/sceGJfER4edxC0AyDYnvBuFxya5kDwWMZ7cPWywqEc+140fkW09qLkJYn4ler3ZbGcKI3MPrWbv5OyafQzN59bmbCOzMMCNqYUilvcQ7uEk5/lT6JaD4a/FD0u9WacQHlqUkSBSsAtAu4QsGH6R/6oUA== 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=7KR9vqYiqFxqO7gVO6iJr8E86tZZ3waNhSE/d0wRQKg=; b=FkzHsuqqF539oHzYcQ7ibE34V/6MdcSIWl9OBtylHB5GmEv+2quh35balETfw1zET5TT4kMGgeBhe1lXIWSQjUvFvEeEnkYk1TnGsNNMxpSA2gOqXPMs/umZgAuzCGZ05KXWVneK3HDx9LSBHwJwaBGFkzr20vhKIj+QqulKpRU/fO9g3Y8x57S69VGH3DKfq+XC3FkLfw5DS2xqoiEeTGt7h0KqEeRXyM2lPA3DyoX4VfLcqSWLNbxn5o46PaPnwJTdracmQDZqELQ+EJlbtcvTIVw5NUIWKo3NtgjG5O5QOg+xGGjboVNRdiLJzCX0zcyiEyKczhR5/Cn77n43Dg== Received: from BL1PR13CA0110.namprd13.prod.outlook.com (2603:10b6:208:2b9::25) by PH7PR12MB6585.namprd12.prod.outlook.com (2603:10b6:510:213::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 06:33:37 +0000 Received: from BN2PEPF000055E0.namprd21.prod.outlook.com (2603:10b6:208:2b9:cafe::6b) by BL1PR13CA0110.outlook.office365.com (2603:10b6:208:2b9::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:33:37 +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 BN2PEPF000055E0.mail.protection.outlook.com (10.167.245.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.1 via Frontend Transport; Mon, 11 Nov 2024 06:33: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; Sun, 10 Nov 2024 22:33: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; Sun, 10 Nov 2024 22:33:25 -0800 From: Xueming Li To: Hernan Vargas CC: , Maxime Coquelin , "dpdk stable" Subject: patch 'baseband/acc: fix access to deallocated mem' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:30 +0800 Message-ID: <20241111062847.216344-45-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055E0:EE_|PH7PR12MB6585:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f90073f-4001-4d0a-8fd1-08dd021ac5de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6RpjER194Vz8FkMj1EZL1KGT2uKu6CmfWQx7lBHWFrJIKn1TunJZ+3h7CoI/?= =?us-ascii?Q?ILntjdWlKkFzH+tUNZX11+p+dG4+EAleDc7gaUuAiHoX+OCFbctmsnvE5Ws1?= =?us-ascii?Q?2JNEPp2i/gpVhCeo06Fs6QIqwO6eJySbrCyyzxTnaXefIswkTwNUsW7OTgdo?= =?us-ascii?Q?d7hac+ayFSp9em6qIf5emM5Z3yspseS2pslTSjF3gOGkC1J4UxZaLPREsicW?= =?us-ascii?Q?wr9FxfrG8L3ADaPzbPy6yuxQCf3VYxmZBLsGlYuenAHNyFMM/EskDYMGD1tS?= =?us-ascii?Q?wDl4Mk0acn5uzp7rGE8AHDAHYUf8k+ezQwGxicS7XcQHoneeef+w7d6muuh+?= =?us-ascii?Q?2Zo/eRA2SYSz5/Hq+wyZGHf4NaMnxozBZGQ3EqQuusOs/L/kTAEfaBVNx3q6?= =?us-ascii?Q?34w8uPnUm8/efLlO5519MytmE+0Wyqw025UUm62Mu2c6CUYzm1ZtF6tcM9SM?= =?us-ascii?Q?FL2FVxT6oz9vONtwN2QbUGnGnP+tssbFlRxko+Ov0b+WKDjfgw6W6uqruWnh?= =?us-ascii?Q?RV9iFg4CbPIQImxjHLVAINV9WqOo1tDAZex+6rxJ5jY2hzJG05CRyMI+cM8t?= =?us-ascii?Q?nxlJmPnC173LWYUr35UUEJrDKAdvegWjXvhqeSQorA5ZMS/dEBst59MAgRrl?= =?us-ascii?Q?iJiRXIo0loTnl54Wa27FkLv/J0PU+BKAfCEQlJtwFOUQs5qAh1LCGmZeo0Gt?= =?us-ascii?Q?eip82La5HDP7AXUveKspgyg9eFbHFqWquVyPISTwcHk1SFQAdBpxCbCc033U?= =?us-ascii?Q?bXNfymuC8ZfexC8xlHdwgD798dOiovpmwjjnJ5ccxRAQdh9bKEvYeklGA8Lq?= =?us-ascii?Q?qQY046uSn2Oq3UJ4Dur7pn1+U1HiWG4HBtLlDI3YnsnYf522da+WSnKtlRtj?= =?us-ascii?Q?ATN2s+IbdA74O4bn3xglm8yst7l5r5xmIFl9KpttXU/evmHVG++AiXA5dwRX?= =?us-ascii?Q?grQF8Bqmk8OS7M6g89AWXQXTCiGoubM2YhujEQmyCWCLJP2sTri65sMITP7Q?= =?us-ascii?Q?GsVvypGdDC+U4L5Ybkxuszt7KNc44IcVkXchKFARYysoMGgQUDE7wD/HEonA?= =?us-ascii?Q?4dlCJoxBOFQKgpOTVKCgJufcvnkgNOwP70necA6ms9Kkj+AcXNsEghO+jqN3?= =?us-ascii?Q?NwDeCSnl70pZt9eXh22oAdUrh/Nf9GyEPDCUb5pqd1k+g8ELR7MjF0lU+PPK?= =?us-ascii?Q?nwwcXyxBQS/4T/R/FWwsZtXkr0Xh7iGRrYHRQO6vHMmSEZLvaXkIwxyMim54?= =?us-ascii?Q?RnqBfkDtgoZSkBtAwzmplyVi06kHqcDaBcprHxG7fCqBelqFCsOQIlRFMHkq?= =?us-ascii?Q?hKvoEQV0AlreLhMfgNX8Rj5kilSDPoLbMt2teiR8XatmSm3DVWe4HkLA+1Pn?= =?us-ascii?Q?5qytssI6+bN/i8tnhzqSYlPtyI5Gy9MzjOXX2J3K6vTLa6ow2A=3D=3D?= 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)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:33:36.6549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f90073f-4001-4d0a-8fd1-08dd021ac5de 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: BN2PEPF000055E0.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6585 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 11/30/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=25491476c647f6dac991948667d804e334b39aa9 Thanks. Xueming Li --- >From 25491476c647f6dac991948667d804e334b39aa9 Mon Sep 17 00:00:00 2001 From: Hernan Vargas Date: Wed, 9 Oct 2024 14:12:51 -0700 Subject: [PATCH] baseband/acc: fix access to deallocated mem Cc: Xueming Li [ upstream commit a090b8ffe73ed21d54e17e5d5711d2e817d7229e ] Prevent op_addr access during queue_stop operation, as this memory may have been deallocated. Fixes: e640f6cdfa84 ("baseband/acc200: add LDPC processing") Signed-off-by: Hernan Vargas Reviewed-by: Maxime Coquelin --- drivers/baseband/acc/rte_acc100_pmd.c | 36 ---------------------- drivers/baseband/acc/rte_vrb_pmd.c | 44 +-------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index 9d028f0f48..3e135c480d 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -838,51 +838,15 @@ free_q: return ret; } -static inline void -acc100_print_op(struct rte_bbdev_dec_op *op, enum rte_bbdev_op_type op_type, - uint16_t index) -{ - if (op == NULL) - return; - if (op_type == RTE_BBDEV_OP_LDPC_DEC) - rte_bbdev_log(DEBUG, - " Op 5GUL %d %d %d %d %d %d %d %d %d %d %d %d", - index, - op->ldpc_dec.basegraph, op->ldpc_dec.z_c, - op->ldpc_dec.n_cb, op->ldpc_dec.q_m, - op->ldpc_dec.n_filler, op->ldpc_dec.cb_params.e, - op->ldpc_dec.op_flags, op->ldpc_dec.rv_index, - op->ldpc_dec.iter_max, op->ldpc_dec.iter_count, - op->ldpc_dec.harq_combined_input.length - ); - else if (op_type == RTE_BBDEV_OP_LDPC_ENC) { - struct rte_bbdev_enc_op *op_dl = (struct rte_bbdev_enc_op *) op; - rte_bbdev_log(DEBUG, - " Op 5GDL %d %d %d %d %d %d %d %d %d", - index, - op_dl->ldpc_enc.basegraph, op_dl->ldpc_enc.z_c, - op_dl->ldpc_enc.n_cb, op_dl->ldpc_enc.q_m, - op_dl->ldpc_enc.n_filler, op_dl->ldpc_enc.cb_params.e, - op_dl->ldpc_enc.op_flags, op_dl->ldpc_enc.rv_index - ); - } -} - static int acc100_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) { struct acc_queue *q; - struct rte_bbdev_dec_op *op; - uint16_t i; q = dev->data->queues[queue_id].queue_private; rte_bbdev_log(INFO, "Queue Stop %d H/T/D %d %d %x OpType %d", queue_id, q->sw_ring_head, q->sw_ring_tail, q->sw_ring_depth, q->op_type); - for (i = 0; i < q->sw_ring_depth; ++i) { - op = (q->ring_addr + i)->req.op_addr; - acc100_print_op(op, q->op_type, i); - } /* ignore all operations in flight and clear counters */ q->sw_ring_tail = q->sw_ring_head; q->aq_enqueued = 0; diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c index 88e1d03ebf..2ff3f313cb 100644 --- a/drivers/baseband/acc/rte_vrb_pmd.c +++ b/drivers/baseband/acc/rte_vrb_pmd.c @@ -1047,58 +1047,16 @@ free_q: return ret; } -static inline void -vrb_print_op(struct rte_bbdev_dec_op *op, enum rte_bbdev_op_type op_type, - uint16_t index) -{ - if (op == NULL) - return; - if (op_type == RTE_BBDEV_OP_LDPC_DEC) - rte_bbdev_log(INFO, - " Op 5GUL %d %d %d %d %d %d %d %d %d %d %d %d", - index, - op->ldpc_dec.basegraph, op->ldpc_dec.z_c, - op->ldpc_dec.n_cb, op->ldpc_dec.q_m, - op->ldpc_dec.n_filler, op->ldpc_dec.cb_params.e, - op->ldpc_dec.op_flags, op->ldpc_dec.rv_index, - op->ldpc_dec.iter_max, op->ldpc_dec.iter_count, - op->ldpc_dec.harq_combined_input.length - ); - else if (op_type == RTE_BBDEV_OP_LDPC_ENC) { - struct rte_bbdev_enc_op *op_dl = (struct rte_bbdev_enc_op *) op; - rte_bbdev_log(INFO, - " Op 5GDL %d %d %d %d %d %d %d %d %d", - index, - op_dl->ldpc_enc.basegraph, op_dl->ldpc_enc.z_c, - op_dl->ldpc_enc.n_cb, op_dl->ldpc_enc.q_m, - op_dl->ldpc_enc.n_filler, op_dl->ldpc_enc.cb_params.e, - op_dl->ldpc_enc.op_flags, op_dl->ldpc_enc.rv_index - ); - } else if (op_type == RTE_BBDEV_OP_MLDTS) { - struct rte_bbdev_mldts_op *op_mldts = (struct rte_bbdev_mldts_op *) op; - rte_bbdev_log(INFO, " Op MLD %d RBs %d NL %d Rp %d %d %x", - index, - op_mldts->mldts.num_rbs, op_mldts->mldts.num_layers, - op_mldts->mldts.r_rep, - op_mldts->mldts.c_rep, op_mldts->mldts.op_flags); - } -} - /* Stop queue and clear counters. */ static int vrb_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) { struct acc_queue *q; - struct rte_bbdev_dec_op *op; - uint16_t i; + q = dev->data->queues[queue_id].queue_private; rte_bbdev_log(INFO, "Queue Stop %d H/T/D %d %d %x OpType %d", queue_id, q->sw_ring_head, q->sw_ring_tail, q->sw_ring_depth, q->op_type); - for (i = 0; i < q->sw_ring_depth; ++i) { - op = (q->ring_addr + i)->req.op_addr; - vrb_print_op(op, q->op_type, i); - } /* ignore all operations in flight and clear counters */ q->sw_ring_tail = q->sw_ring_head; q->aq_enqueued = 0; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:07.188469798 +0800 +++ 0044-baseband-acc-fix-access-to-deallocated-mem.patch 2024-11-11 14:23:05.112192840 +0800 @@ -1 +1 @@ -From a090b8ffe73ed21d54e17e5d5711d2e817d7229e Mon Sep 17 00:00:00 2001 +From 25491476c647f6dac991948667d804e334b39aa9 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit a090b8ffe73ed21d54e17e5d5711d2e817d7229e ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index 5e6ee85e13..c690d1492b 100644 +index 9d028f0f48..3e135c480d 100644 @@ -76 +78 @@ -index 646c12ad5c..e3f98d6e42 100644 +index 88e1d03ebf..2ff3f313cb 100644 @@ -79 +81 @@ -@@ -1048,58 +1048,16 @@ free_q: +@@ -1047,58 +1047,16 @@ free_q: