patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Hunt, David" <david.hunt@intel.com>
To: Hamza Khan <hamza.khan@intel.com>,
	Alan Carew <alan.carew@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [PATCH 2/2] examples/vm_power_manager: use safe version of list iterator
Date: Mon, 4 Jul 2022 13:31:45 +0100	[thread overview]
Message-ID: <5a28e603-e360-2be4-ecc1-5b837e41e08e@intel.com> (raw)
In-Reply-To: <20220601105455.166505-2-hamza.khan@intel.com>


On 01/06/2022 11:54, Hamza Khan wrote:
> 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, use the newly added
> LIST_FOREACH_SAFE macro.
>
> Fixes: e8ae9b662506 ("examples/vm_power: channel manager and monitor in host")
> Cc: alan.carew@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Hamza Khan <hamza.khan@intel.com>
> ---
>   examples/vm_power_manager/channel_manager.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
> index 838465ab4b..bc95cec8d6 100644
> --- a/examples/vm_power_manager/channel_manager.c
> +++ b/examples/vm_power_manager/channel_manager.c
> @@ -1005,9 +1005,9 @@ channel_manager_exit(void)
>   {
>   	unsigned i;
>   	char mask[RTE_MAX_LCORE];
> -	struct virtual_machine_info *vm_info;
> +	struct virtual_machine_info *vm_info, *tmp;
>   
> -	LIST_FOREACH(vm_info, &vm_list_head, vms_info) {
> +	LIST_FOREACH_SAFE(vm_info, &vm_list_head, vms_info, tmp) {
>   
>   		rte_spinlock_lock(&(vm_info->config_spinlock));
>   


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



  reply	other threads:[~2022-07-04 12:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220601105455.166505-1-hamza.khan@intel.com>
2022-06-01 10:54 ` Hamza Khan
2022-07-04 12:31   ` Hunt, David [this message]
2022-07-05  2:38     ` Li, WeiyuanX
2022-07-07 15:48 ` [PATCH v2] " Hamza Khan
2022-07-08  8:51 ` [PATCH v3] " Hamza Khan
2022-07-08  9:28   ` Hunt, David
2022-07-19 18:25   ` Pattan, Reshma
2022-08-22 10:58   ` [PATCH v4] " Reshma Pattan
2022-08-22 11:29     ` Hunt, David
2022-10-04 22:09     ` [PATCH v5] " Reshma Pattan
2022-10-05 10:17       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a28e603-e360-2be4-ecc1-5b837e41e08e@intel.com \
    --to=david.hunt@intel.com \
    --cc=alan.carew@intel.com \
    --cc=dev@dpdk.org \
    --cc=hamza.khan@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).