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 1FC5945BB6 for ; Wed, 23 Oct 2024 23:18:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19F1940261; Wed, 23 Oct 2024 23:18:49 +0200 (CEST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id C4A2D432A2 for ; Wed, 23 Oct 2024 23:18:47 +0200 (CEST) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-37d49ffaba6so117636f8f.0 for ; Wed, 23 Oct 2024 14:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729718327; x=1730323127; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b/0qQwp/z/uZHEtcMNeX3I+XsNBrs3WoNmnu0ePuks8=; b=EZ1WGM4HY0RGxNqqLV6wN7hmONPC3LakACfvGJk+YN53yDJ3szra7cGdc0IlzGK1sO Ga82QQdz8woKWHVhsmGCqkGB0tM0wIMn1aDx/3uVVNKU5nEAiSXeRzcd/TW8DBD0hxKy 4pRN/csmPEXAa2OJYpEEegqDqeahHgtOBpzsKd5IlSIIQeKfM2R6jvWnIQOKThS1tz+z S/jp9z6a/n+QRkQQPofoGOhh4dZ5hHI1KzIqcV4ovUF+vpxDJBm4d5tcKN6ldwWt6vUO xSfcrnjyKn/npRqm3UhjFYhw4qyyOJTEGOKqhOiDjcdnwmYDtyugg25qE9cuWqcAA56I WyRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729718327; x=1730323127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b/0qQwp/z/uZHEtcMNeX3I+XsNBrs3WoNmnu0ePuks8=; b=Zj/p6eC/6dRJ5BostbF0KnaUCSKCjsbk6arRghtMogyUrXYB+PPsbbNwQMeMBmQ5y5 NyoNtz/xvCcjAYFEY6Q5aJ6ANdwHvczvu5sgIKEBnFey1TtNlcghp0bJgcafpeSsRmAL RXJNWL/f6P8iNCUnODXR7Dj2eCY6ND4qX5P7zs2Lo23xDkMHykjnRlt5n/s2bC5QHyaq lcL5DKWm3IzPcYhthiwQ+wypEn9zpWq5fh6lRBDxTcaniGUYOKVVPnG0u/xqMt22v5LV khHOiNm3S2h+n7RPgssSP6EK+X6Lf+2imq9/wSjnSDRshbgBjcqxAjWEE8+TwXxt/WRz Palg== X-Forwarded-Encrypted: i=1; AJvYcCV8eCClnjlEjYv8mkzrVfRPsMAr59VNVKkxgFFcOd1idoKNwWdU8EgrsVPOc0u3q+V2e/7Qccs=@dpdk.org X-Gm-Message-State: AOJu0YxdcM8SBEjzfKz9Q1pLrDGQjznf/TuLx1D4HfiJRBxhfGBzxJi3 Qy6Jf/P+5uHuBHHkzUowPVBg9m4hoj5MOvFBVPa98FC5KqNcYpu9 X-Google-Smtp-Source: AGHT+IF3cdkDd111vlMrueNh0bzrfiChgGAoQmKcowA2t0aeU89j/na7er4LNVaiz6MlM5R8doFfQA== X-Received: by 2002:adf:ef4a:0:b0:37d:3e5b:feac with SMTP id ffacd0b85a97d-37efcfaaa78mr2596516f8f.59.1729718327234; Wed, 23 Oct 2024 14:18:47 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0a614d0sm9778458f8f.63.2024.10.23.14.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 14:18:46 -0700 (PDT) From: luca.boccassi@gmail.com To: Hernan Vargas Cc: Maxime Coquelin , dpdk stable Subject: patch 'baseband/acc: fix access to deallocated mem' has been queued to stable release 22.11.7 Date: Wed, 23 Oct 2024 22:16:08 +0100 Message-ID: <20241023211704.1216956-28-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241023211704.1216956-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/25/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/e8d41d4db2561550810000b00b6c6775907833c3 Thanks. Luca Boccassi --- >From e8d41d4db2561550810000b00b6c6775907833c3 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 [ 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_acc200_pmd.c | 37 +-------------------------- 2 files changed, 1 insertion(+), 72 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index 955c0236e4..a5b1bb66eb 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -837,51 +837,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_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c index 8bda3a8e07..f2b7172e71 100644 --- a/drivers/baseband/acc/rte_acc200_pmd.c +++ b/drivers/baseband/acc/rte_acc200_pmd.c @@ -924,51 +924,16 @@ free_q: return ret; } -static inline void -acc200_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 - ); - } -} - /* Stop ACC200 queue and clear counters. */ static int acc200_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; - acc200_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.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-10-23 22:16:41.588552062 +0100 +++ 0028-baseband-acc-fix-access-to-deallocated-mem.patch 2024-10-23 22:16:40.463941341 +0100 @@ -1 +1 @@ -From a090b8ffe73ed21d54e17e5d5711d2e817d7229e Mon Sep 17 00:00:00 2001 +From e8d41d4db2561550810000b00b6c6775907833c3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a090b8ffe73ed21d54e17e5d5711d2e817d7229e ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15,3 +16,3 @@ - drivers/baseband/acc/rte_acc100_pmd.c | 36 ---------------------- - drivers/baseband/acc/rte_vrb_pmd.c | 44 +-------------------------- - 2 files changed, 1 insertion(+), 79 deletions(-) + drivers/baseband/acc/rte_acc100_pmd.c | 36 -------------------------- + drivers/baseband/acc/rte_acc200_pmd.c | 37 +-------------------------- + 2 files changed, 1 insertion(+), 72 deletions(-) @@ -20 +21 @@ -index 5e6ee85e13..c690d1492b 100644 +index 955c0236e4..a5b1bb66eb 100644 @@ -23 +24 @@ -@@ -838,51 +838,15 @@ free_q: +@@ -837,51 +837,15 @@ free_q: @@ -75,5 +76,5 @@ -diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c -index 646c12ad5c..e3f98d6e42 100644 ---- a/drivers/baseband/acc/rte_vrb_pmd.c -+++ b/drivers/baseband/acc/rte_vrb_pmd.c -@@ -1048,58 +1048,16 @@ free_q: +diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c +index 8bda3a8e07..f2b7172e71 100644 +--- a/drivers/baseband/acc/rte_acc200_pmd.c ++++ b/drivers/baseband/acc/rte_acc200_pmd.c +@@ -924,51 +924,16 @@ free_q: @@ -84 +85 @@ --vrb_print_op(struct rte_bbdev_dec_op *op, enum rte_bbdev_op_type op_type, +-acc200_print_op(struct rte_bbdev_dec_op *op, enum rte_bbdev_op_type op_type, @@ -110,7 +110,0 @@ -- } 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); @@ -120 +114 @@ - /* Stop queue and clear counters. */ + /* Stop ACC200 queue and clear counters. */ @@ -122 +116 @@ - vrb_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) + acc200_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) @@ -134 +128 @@ -- vrb_print_op(op, q->op_type, i); +- acc200_print_op(op, q->op_type, i);