DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix flow cfg double-free after reattach
@ 2026-07-06 11:52 Maayan Kashani
  2026-07-10 21:45 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Maayan Kashani @ 2026-07-06 11:52 UTC (permalink / raw)
  To: dev; +Cc: mkashani, rasland, Shani Peretz, stable, Dariusz Sosnowski,
	Aman Singh

From: Shani Peretz <shperetz@nvidia.com>

When a port is closed via close_port(), port_free_job_list() frees the
job_list but does not NULL the pointer or reset queue_nb. If the port
is later reattached and "flow configure" is issued, port_flow_configure()
frees the dangling job_list pointer, causing a double-free.

Fix this by setting job_list to NULL and resetting queue_nb to zero in
port_free_job_list() after freeing.

Fixes: 7fadc8039588 ("app/testpmd: fix memory leak in port flow configure")
Cc: stable@dpdk.org

Signed-off-by: Shani Peretz <shperetz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 app/test-pmd/testpmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9a85657840a..ef337a4d144 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3358,6 +3358,8 @@ port_free_job_list(portid_t pi)
 {
 	struct rte_port *port = &ports[pi];
 	free(port->job_list);
+	port->job_list = NULL;
+	port->queue_nb = 0;
 }
 
 static void
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] app/testpmd: fix flow cfg double-free after reattach
  2026-07-06 11:52 [PATCH] app/testpmd: fix flow cfg double-free after reattach Maayan Kashani
@ 2026-07-10 21:45 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2026-07-10 21:45 UTC (permalink / raw)
  To: Shani Peretz, Maayan Kashani
  Cc: dev, stable, rasland, Dariusz Sosnowski, Aman Singh

06/07/2026 13:52, Maayan Kashani:
> From: Shani Peretz <shperetz@nvidia.com>
> 
> When a port is closed via close_port(), port_free_job_list() frees the
> job_list but does not NULL the pointer or reset queue_nb. If the port
> is later reattached and "flow configure" is issued, port_flow_configure()
> frees the dangling job_list pointer, causing a double-free.
> 
> Fix this by setting job_list to NULL and resetting queue_nb to zero in
> port_free_job_list() after freeing.
> 
> Fixes: 7fadc8039588 ("app/testpmd: fix memory leak in port flow configure")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shani Peretz <shperetz@nvidia.com>
> Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

Applied, thanks.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-10 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 11:52 [PATCH] app/testpmd: fix flow cfg double-free after reattach Maayan Kashani
2026-07-10 21:45 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox