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 9A61CA034F; Wed, 10 Nov 2021 19:58:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8455B4113C; Wed, 10 Nov 2021 19:58:31 +0100 (CET) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) by mails.dpdk.org (Postfix) with ESMTP id C5B6740DDA; Wed, 10 Nov 2021 19:58:29 +0100 (CET) Received: by mail-il1-f169.google.com with SMTP id i9so3532461ilu.8; Wed, 10 Nov 2021 10:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xYcMKwA51hRo3RUpfL7jco6eYvQtB+cMIGcWvEPQ11g=; b=JtREmie1WDf9F/7kyc70v7VEMkzsONFjVRCdA3PKpxqz83tWJusAMr8wGEAiNVg+DM 99ADSUQYaItmz648c0DtjGyrBpR2cWHlSs9CqYG7uVEEJF8VjXxRWkw7sPzlsOkV5rX1 DkfVI+QMFlKYWVZ5cgW4UR5iFSB0NlAveVK1iQMuY2WHoh5vYjKgNXJC7X4dKY7DKAoH eXtXMfHyLFdF+80BnI3oexW3e1Jukei9HJ0K+FQsNnrOsHip+10grFEAZ2N0AKBec01o 5czvaMCy+K09lB9C1eJz1M1wb49Oc84NvRleSQC0x4L+3Ot0L/k6GxCBc+LZtZJOuAmq 7TtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xYcMKwA51hRo3RUpfL7jco6eYvQtB+cMIGcWvEPQ11g=; b=i3KbhkaPfES7XS7zhXhDFHOvu6kkGz84tWNvZg3q7Tft7jqIlHkv9jPWLk/pPenWIx IeJ8GmmKjd+Wcj5xmAotrjUH/c+I+Dse2x2Tjo2oyVgIkzK/wROnYWx0YbZdZHq7TUwS g3GwlHVTNzfBTcYV5L6DDu4oEzhsjo+n0HyS5KXDjDyAkwQC9lo5qkDV8LjUPvuafSQs hD5pcRgL80T5tjvPdgmj4QD+1nXMbDCPKdzWgcfi/IafMnXBRYr7DLVyM89CJDmkQn8z PoIZD65qiltD8VLGIVkUAAlCQZmG+Isavw20s4lH+IJcmTyn/jfx6GsBKbEoZVJZjarb IwbQ== X-Gm-Message-State: AOAM531RgmY1UiKpuwiXRPEutpPiYEPDcsW2oqk+t7D2hRejAZw9FXxk pYfE7m4S2L33ntp/qQlyz9NoCkoKTyXO69yKjQE= X-Google-Smtp-Source: ABdhPJzk2XEsD/Lg8W4JvaL6qAqPJFu5EfL1v9uKcqv/WJV6oePri6oBjkDy0vFKEYeTDiOcVQK7ZDXx5GrLz0iSEts= X-Received: by 2002:a05:6e02:1bcb:: with SMTP id x11mr772508ilv.94.1636570709195; Wed, 10 Nov 2021 10:58:29 -0800 (PST) MIME-Version: 1.0 References: <20211109073334.3910034-1-s.v.naga.harish.k@intel.com> <20211110060015.258508-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20211110060015.258508-1-s.v.naga.harish.k@intel.com> From: Jerin Jacob Date: Thu, 11 Nov 2021 00:28:03 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH v2] eventdev/eth_tx: fix queue_del function To: Naga Harish K S V Cc: Jerin Jacob , "Jayatheerthan, Jay" , dpdk-dev , dpdk stable Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Nov 10, 2021 at 11:30 AM Naga Harish K S V wrote: > > 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 Updated the commit log as: eventdev/eth_tx: fix queue delete logic This patch fixes heap-use-after-free reported by ASan. 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 Tested-by: David Marchand Applied to dpdk-next-net-eventdev/for-main. Thanks > --- > 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 >