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 C68A7423FE; Tue, 17 Jan 2023 17:01:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7C59400EF; Tue, 17 Jan 2023 17:01:15 +0100 (CET) Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) by mails.dpdk.org (Postfix) with ESMTP id 9089A400D4; Tue, 17 Jan 2023 17:01:13 +0100 (CET) Received: by mail-ua1-f45.google.com with SMTP id f26so7610445uab.2; Tue, 17 Jan 2023 08:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Zl9GWFeZ0NgD7maXx3heF+HCVknPRqY+2USP2pjXgjY=; b=Ay6eP+J0os85xiyaK6loaRUEBF90IY9ZqwVsdSejSCDJzeDeEKljm6bLgo9EbF/BGv 47oRBt7PKdqoRZ8sN5DcAk5F8m8ctj2YhQz/HwYx2rpNy/LYZipgjfHPMnP/rc9r7D6a ZEDgct/WrQPtsUQPhCJqZZ6uY/wI23v7PAnybct91EIATIwNrklwhdNgLRxVZZApry2B ISxOo6kk+RJ9yOeARPtR8m38Za9p7nlrXC4CG4wWTogOzGqmArD7vPxRggc2CYWaaEhS ES6Bozq+TP0vuYoDOpQb23QzmI5RmEL6414MgbIZPnjLH8Awbs6kbZGSkzz3t1YrMoat om5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Zl9GWFeZ0NgD7maXx3heF+HCVknPRqY+2USP2pjXgjY=; b=jMFSbEQpRdnQdnBkRebZVBfokKHkNKuwwN8mRtEOmego4gh34sR/TbPkNise2rlafc 5+6pxWXFPy6dc8zpOKfAXbq0R5yS3kUhpKOx/bEmYPbXg/Nkx7Rnsm3DwrbVWVk5RKdj CZdATehaYfyDFYoXEGO9b3fKdVXB+eqFVTS8b2apuLFa2b8AtqqXJTY7qnmkPtdBn0on Jzm1NDVi4TLbC0AdVL6Wc+NixwJeGxbCYhRxPjKI+6vDbw+dxYnknoFckoilJDSu8jb0 a/qdB4idEKNWD4z1XKma+GgT/4GLEGWHNNFrhdy58TYXsnFBamfhVi0xoCC2HAVtI82J wSXQ== X-Gm-Message-State: AFqh2kqj/2gHV5NUtDB9KJelzQmv4HO+nxipFWk5PvvEatC0a0OdYiq+ jR3IjYf+MdtQL99QOi/k1Ytkmf/64BjGMAoY5VI= X-Google-Smtp-Source: AMrXdXtAjTK9z+blCTvRR5IrHkOyWYP3SwuTHVi7sgbqi1DD7/6R9cE7yVwZskQE17+xvavP+kUquvHzAhHGixQD6C8= X-Received: by 2002:ab0:3b02:0:b0:55a:a7aa:76f with SMTP id n2-20020ab03b02000000b0055aa7aa076fmr387793uaw.15.1673971272852; Tue, 17 Jan 2023 08:01:12 -0800 (PST) MIME-Version: 1.0 References: <20230107164058.3709813-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20230107164058.3709813-1-s.v.naga.harish.k@intel.com> From: Jerin Jacob Date: Tue, 17 Jan 2023 21:30:46 +0530 Message-ID: Subject: Re: [PATCH] eventdev/eth_tx: fix service function To: Naga Harish K S V Cc: jerinj@marvell.com, dev@dpdk.org, jay.jayatheerthan@intel.com, stable@dpdk.org 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 Sat, Jan 7, 2023 at 10:11 PM Naga Harish K S V wrote: > > adapter service function is using RTE_ETH_FOREACH_DEV() macro for > looping through all available eth devices and flushing any pending > buffered packets. > > When Traffic Management nodes (vports) are added and deleted dynamically, > there is a possibility of accessing the device info memory beyond the > allocated limit which can result in segfaults. Fixed the logic to > prevent illegal memory access. > > Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") > Cc: stable@dpdk.org > > Signed-off-by: Naga Harish K S V Updated the git commit as follows and applied to dpdk-next-net-eventdev/for-main. Thanks eventdev/eth_tx: fix invalid memory access Adapter service function is using RTE_ETH_FOREACH_DEV() macro for looping through all available eth devices and flushing any pending buffered packets. When Traffic Management nodes (vports) are added and deleted dynamically, there is a possibility of accessing the device info memory beyond the allocated limit which can result in segfaults. Fixed the logic to prevent illegal memory access. Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") Cc: stable@dpdk.org Signed-off-by: Naga Harish K S V > --- > 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 88309d2aaa..ba7a1c7f1b 100644 > --- a/lib/eventdev/rte_event_eth_tx_adapter.c > +++ b/lib/eventdev/rte_event_eth_tx_adapter.c > @@ -676,7 +676,7 @@ txa_service_func(void *args) > RTE_ETH_FOREACH_DEV(i) { > uint16_t q; > > - if (i == txa->dev_count) > + if (i >= txa->dev_count) > break; > > dev = tdi[i].dev; > -- > 2.25.1 >