[PATCH v4] examples/vm_power_manager: use safe version of list iterator

Hunt, David david.hunt at intel.com
Mon Aug 22 13:29:44 CEST 2022


On 22/08/2022 11:58, Reshma Pattan wrote:
> From: Hamza Khan <hamza.khan at intel.com>
>
> Currently, when vm_power_manager exits, we are using a LIST_FOREACH
> macro to iterate over VM info structures while freeing them. This
> leads to use-after-free error. To address this, replace all usages of
> LIST_* with TAILQ_* macros, and use the RTE_TAILQ_FOREACH_SAFE macro
> to iterate and delete VM info structures.
>
> * The change is small and doesn’t affect other code
> * Testing was performed on the patch
>
> Fixes: e8ae9b662506 ("examples/vm_power: channel manager and monitor in host")
> Cc: alan.carew at intel.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Hamza Khan <hamza.khan at intel.com>
> Reviewed-by: Reshma Pattan <reshma.pattan at intel.com>
> Acked-by: Reshma Pattan <reshma.pattan at intel.cm>
> Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
> ---
> v4: fix header file inclusion
> ---

--snip--

Acked-by: David Hunt <david.hunt at intel.com>




More information about the dev mailing list