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 86E9E428F8 for ; Sun, 9 Apr 2023 17:26:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 818244114A; Sun, 9 Apr 2023 17:26:25 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id DD853406B8 for ; Sun, 9 Apr 2023 17:26:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gmL2wv8uKEesNIrBmhpQKrx9ARFZTqY3mQzItyR7+luY1y4UHOFs6UXE2gNKZV9y8jebUE33aKn9sz9cAjmY1qtDYkxJlZ+cWEbgwvdgUL/h+Pwff9YzYjKImkV26b7oQMUfJhYcMKtAPaiwAL8b7ImI1a5tuQogxlmtRklPDZ2EvAmMt1NmTxWeqF1J7haizrwhlEpdYDTchGwGL0ppM2GVaOxlrp8xjSaZmWn8E62+1pq6Q6w44Yh8l5CWViSHVCr4zMYn/boV9VvwKfhBLogwR3OUBy7S0HL0kHYLerHy/GSc7jOhZe4KvVUggvJn73QDoITKDEwzEAxvIOYPfA== 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=3QqTJSI/yNXma03JqmhrKyrczK03G83nnTRMvd2/Hnw=; b=L2Prw/zNqoZ3wvFwGZoa3ivpwQsQ4pq3SUNCdWol6g6xDKyMUKNHRmPZX+cmvYcsg3QTBDWd2Kt/S1pUD1hh05lZbGObwCq3jrSgVWsANXsaIWnGA8InygRavpZIqVVGOX7afP8D/lVZMGm8TmnKpsJubmzDYKIgYRzHSBZQDrNh1vwPleacq1/paOE1argmbiMA5rYQJ/1JWad2cWoihDrf0Mqwso9TMl6malzDFSy+rhMn1v7OlAkuEoma5QeANl+jNV6O1roe6fiqqePUvFwiiVGxKJ3OJv8ccazuORShwpI85o31arwS/ICiQ2/nxFz1BptSqiQx3lgR0fj11g== 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 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=3QqTJSI/yNXma03JqmhrKyrczK03G83nnTRMvd2/Hnw=; b=jVbZ+909ZLe78OLpu+mSAsMbH18HY7wbZcyNchZfhyPwHGKbeEOU6O0oe1XMKoRm5WkC6vx0TJy2Rp8etz1iPOm/WhUwR1MEy7ZvEDJAeBAlU7sMXzdfREP1BWCZtRVQGQJDtOWhAgYcsOdROKXtiLYLmCS0kK6jdjY/XQOmlg19zlDl6G77QN4xggxmaOy0uQAyFQ/ajPoSMlFpwSkbgg8j3+cdrbeC5xSe9ylBpfsV7c/GSV5k9eFiQUIxJ/OylOBMR5emwWWdYVsqRzPRBagLvXDsINylkZuPwUmcyfKJRXoot1MfVZaoiayJ2LgWeXmK7y/SctcMMLhf9T97ZQ== Received: from MW4PR03CA0280.namprd03.prod.outlook.com (2603:10b6:303:b5::15) by CY5PR12MB6622.namprd12.prod.outlook.com (2603:10b6:930:42::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Sun, 9 Apr 2023 15:26:22 +0000 Received: from CO1NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b5:cafe::e6) by MW4PR03CA0280.outlook.office365.com (2603:10b6:303:b5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36 via Frontend Transport; Sun, 9 Apr 2023 15:26:22 +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 CO1NAM11FT012.mail.protection.outlook.com (10.13.175.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.25 via Frontend Transport; Sun, 9 Apr 2023 15:26:21 +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.986.5; Sun, 9 Apr 2023 08:26:17 -0700 Received: from nvidia.com (10.126.230.37) 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.986.37; Sun, 9 Apr 2023 08:26:16 -0700 From: Xueming Li To: Nicolas Chautru CC: Maxime Coquelin , dpdk stable Subject: patch 'baseband/acc: protect from TB negative scenario' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:23:16 +0800 Message-ID: <20230409152529.5308-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT012:EE_|CY5PR12MB6622:EE_ X-MS-Office365-Filtering-Correlation-Id: 6717df24-2a3d-48ee-dcfb-08db390ec631 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4pcSTzRElJzZEOM2MBrKCEEwVCU82qdir22+70S/2GQXB4FkvVrkb4zW43WJZXKdVfduvSt9iqWY3Rr2Gg62JKUhuPgOseROu9Nau18385XibRRQdgQ5oRQ8t6AIQFQwNEcBfJC+pMUKr6ckMgU8t/DuR4SHOM9irJ/i9mdOP/0lvZQNgri1p1jsxWGTJAf1xxOyvtkBpNdQu0uWAP+d/LXdwdBG23WX/JT24S5jJc57kpTEx9l4tt5WVPrQTAFW2hwrJArL4gWhtd6Ph2uh5AWbFojoi/7TafU62yAY0IWASygwGVb8oZ5VLhGtJKFehcR6flftHK0G8u5S3iYyMIqcIZ6lyMReU5W1jjog1OcbN9RXa9bpbPua1597cT0VmWIsKpzkFGGvycwPT0QzIx+rmp8NcXSg1Hk4MuHNRdyOPV0Ls8A3KJgTvfQwe06hICqKFPfJDnwVIXLTghcxOu6TRwj+/4AvpKZhPj4LzKO6G9U/e44SZ7LYqPRGSeU5ppRPaDfOSe/M9u+w0Ow2+uK5ZwtY8rs+hB6srw6PtUAkvSSQMJt+lSAauUPAMScFsHirLnABBVxX4brsyjKb/41osAJlOqWnfINKjwLUKAbYHhT/9NhdD8IcIoPHv8dnhrJ8sAGuS8WWuRZbxTc97bUPYHOSJ8epO4J/FSgLROWSUnD72oWA/XurJ+X40iel1ZVm9Ye3XQBqHumqOLw/lQ2zRwsoY9i9POmlQEF7W0IVxmbo1RyewRZk15jHzxzx+57rj1mydqGgOi8giXKLf2iPg7rP8y70hWJ6Rk6bkGyNcMtTvGpF/uit59iaXt/Wt1LgKfHXt9JN2olUfl2MGA== 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:(13230028)(4636009)(346002)(396003)(376002)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(36756003)(40460700003)(82310400005)(2906002)(5660300002)(8936002)(8676002)(55016003)(40480700001)(86362001)(966005)(7696005)(1076003)(26005)(54906003)(36860700001)(478600001)(2616005)(47076005)(83380400001)(336012)(426003)(6286002)(186003)(16526019)(53546011)(70586007)(70206006)(82740400003)(356005)(7636003)(41300700001)(6916009)(4326008)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:26:21.9445 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6717df24-2a3d-48ee-dcfb-08db390ec631 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: CO1NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6622 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 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/23. 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=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/63797158c21f45dd60ea5b69d3ae91e1c6913e25 Thanks. Xueming Li --- >From 63797158c21f45dd60ea5b69d3ae91e1c6913e25 Mon Sep 17 00:00:00 2001 From: Nicolas Chautru Date: Fri, 10 Feb 2023 17:58:33 +0000 Subject: [PATCH] baseband/acc: protect from TB negative scenario Cc: Xueming Li [ upstream commit 68baaa839250a2a124143b34d4119f218c815d21 ] Adding handling of negative scenario for malformed Transport Block mode operations. Fixes: bec597b78a0e ("baseband/acc200: add LTE processing") Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin --- drivers/baseband/acc/rte_acc200_pmd.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c index c5123cfef0..fe4be5b42b 100644 --- a/drivers/baseband/acc/rte_acc200_pmd.c +++ b/drivers/baseband/acc/rte_acc200_pmd.c @@ -1848,6 +1848,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, r = op->turbo_enc.tb_params.r; while (mbuf_total_left > 0 && r < c) { + if (unlikely((input == NULL) || (output == NULL))) + return -1; + seg_total_left = rte_pktmbuf_data_len(input) - in_offset; /* Set up DMA descriptor */ desc = acc_desc(q, total_enqueued_cbs); @@ -1882,6 +1885,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, r++; } + /* In case the number of CB doesn't match, the configuration was invalid. */ + if (unlikely(current_enqueued_cbs != cbs_in_tb)) + return -1; + /* Set SDone on last CB descriptor for TB mode. */ desc->req.sdone_enable = 1; @@ -2128,6 +2135,9 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, } while (mbuf_total_left > 0 && r < c) { + if (unlikely((input == NULL) || (h_output == NULL))) + return -1; + if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_DEC_SCATTER_GATHER)) seg_total_left = rte_pktmbuf_data_len(input) - in_offset; else @@ -2173,6 +2183,10 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, r++; } + /* In case the number of CB doesn't match, the configuration was invalid. */ + if (unlikely(current_enqueued_cbs != cbs_in_tb)) + return -1; + #ifdef RTE_LIBRTE_BBDEV_DEBUG if (check_mbuf_total_left(mbuf_total_left) != 0) return -EINVAL; @@ -2215,6 +2229,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, r = op->turbo_dec.tb_params.r; while (mbuf_total_left > 0 && r < c) { + if (unlikely((input == NULL) || (h_output == NULL))) + return -1; seg_total_left = rte_pktmbuf_data_len(input) - in_offset; @@ -2265,6 +2281,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, r++; } + /* In case the number of CB doesn't match, the configuration was invalid. */ + if (unlikely(current_enqueued_cbs != cbs_in_tb)) + return -1; + /* Set SDone on last CB descriptor for TB mode */ desc->req.sdone_enable = 1; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:39.036946100 +0800 +++ 0008-baseband-acc-protect-from-TB-negative-scenario.patch 2023-04-09 21:45:38.579042200 +0800 @@ -1 +1 @@ -From 68baaa839250a2a124143b34d4119f218c815d21 Mon Sep 17 00:00:00 2001 +From 63797158c21f45dd60ea5b69d3ae91e1c6913e25 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 68baaa839250a2a124143b34d4119f218c815d21 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -15 +17 @@ - drivers/baseband/acc/rte_vrb_pmd.c | 20 ++++++++++++++++++++ + drivers/baseband/acc/rte_acc200_pmd.c | 20 ++++++++++++++++++++ @@ -18,5 +20,5 @@ -diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c -index 34e42d1f6e..3afaea71a3 100644 ---- a/drivers/baseband/acc/rte_vrb_pmd.c -+++ b/drivers/baseband/acc/rte_vrb_pmd.c -@@ -1820,6 +1820,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, +diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c +index c5123cfef0..fe4be5b42b 100644 +--- a/drivers/baseband/acc/rte_acc200_pmd.c ++++ b/drivers/baseband/acc/rte_acc200_pmd.c +@@ -1848,6 +1848,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, @@ -32 +34 @@ -@@ -1854,6 +1857,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, +@@ -1882,6 +1885,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, @@ -43 +45 @@ -@@ -2100,6 +2107,9 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, +@@ -2128,6 +2135,9 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, @@ -53 +55 @@ -@@ -2145,6 +2155,10 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, +@@ -2173,6 +2183,10 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, @@ -64 +66 @@ -@@ -2187,6 +2201,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, +@@ -2215,6 +2229,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, @@ -73 +75 @@ -@@ -2237,6 +2253,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, +@@ -2265,6 +2281,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,