[PATCH] eventdev/eth_tx: fix service function

Jerin Jacob jerinjacobk at gmail.com
Tue Jan 17 17:00:46 CET 2023


On Sat, Jan 7, 2023 at 10:11 PM Naga Harish K S V
<s.v.naga.harish.k at intel.com> 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 at dpdk.org
>
> Signed-off-by: Naga Harish K S V <s.v.naga.harish.k at intel.com>


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 at dpdk.org

    Signed-off-by: Naga Harish K S V <s.v.naga.harish.k at intel.com>

> ---
>  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
>


More information about the stable mailing list