Skip to content

Commit

Permalink
eventdev/eth_tx: fix queue delete logic
Browse files Browse the repository at this point in the history
[ upstream commit 741b499 ]

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: a3bbf2e ("eventdev: add eth Tx adapter implementation")

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
svnagaha authored and cpaelzer committed Nov 30, 2021
1 parent 43442ef commit 91f6ce9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/librte_eventdev/rte_event_eth_tx_adapter.c
Expand Up @@ -817,7 +817,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;

Expand Down

0 comments on commit 91f6ce9

Please sign in to comment.