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 4D029A034F for ; Wed, 10 Nov 2021 06:56:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D434B410E0; Wed, 10 Nov 2021 06:56:55 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 98E6040142; Wed, 10 Nov 2021 06:56:53 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10163"; a="219504714" X-IronPort-AV: E=Sophos;i="5.87,222,1631602800"; d="scan'208";a="219504714" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 21:56:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,222,1631602800"; d="scan'208";a="503828652" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by orsmga008.jf.intel.com with ESMTP; 09 Nov 2021 21:56:48 -0800 From: Naga Harish K S V To: jerinj@marvell.com, jay.jayatheerthan@intel.com Cc: dev@dpdk.org, stable@dpdk.org Date: Tue, 9 Nov 2021 23:56:45 -0600 Message-Id: <20211110055645.258101-1-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20211109073334.3910034-1-s.v.naga.harish.k@intel.com> References: <20211109073334.3910034-1-s.v.naga.harish.k@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] eventdev/eth_tx: fix queue_del function 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 Sender: "stable" This patch fixes heap-use-after-free reported by ASAN, please reference https://bugs.dpdk.org/show_bug.cgi?id=869 The application can use the queue_id as `-1` to delete all the queues of the eth_device that are added to tx_adapter instance. In above case, the queue_del api is trying to use number of queues from adapter level instead of eth_device queues. When there are queues added from multiple eth devices, it will result in heap-use-after-free as reported by ASAN. This patch fixes the queue_del api to use correct number of queues. Bugzilla ID: 869 Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") Cc: stable@dpdk.org Signed-off-by: Naga Harish K S V Acked-by: Jay Jayatheerthan --- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index da55d2c2dc..c17f33f098 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -864,7 +864,7 @@ txa_service_queue_del(uint8_t id, uint16_t i, q, nb_queues; int ret = 0; - nb_queues = txa->nb_queues; + nb_queues = txa->txa_ethdev[port_id].nb_queues; if (nb_queues == 0) return 0; -- 2.25.1