DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] bus/platform: fix use after free
@ 2023-08-24 10:52 Tomasz Duszynski
  2023-10-02  8:34 ` David Marchand
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Duszynski @ 2023-08-24 10:52 UTC (permalink / raw)
  To: dev, Tomasz Duszynski; +Cc: jerinj, thomas

Remove device from the list before doing actual cleanup to avoid use
after free.

Bugzilla ID: 1276
Fixes: 17c839f74da3 ("bus: add platform bus")

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
 drivers/bus/platform/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/platform/platform.c b/drivers/bus/platform/platform.c
index 9b6ed2832e..7e24bb96a1 100644
--- a/drivers/bus/platform/platform.c
+++ b/drivers/bus/platform/platform.c
@@ -617,8 +617,8 @@ platform_bus_cleanup(void)
 	struct rte_platform_device *pdev, *tmp;
 
 	RTE_TAILQ_FOREACH_SAFE(pdev, &platform_bus.device_list, next, tmp) {
-		platform_bus_unplug(&pdev->device);
 		TAILQ_REMOVE(&platform_bus.device_list, pdev, next);
+		platform_bus_unplug(&pdev->device);
 	}
 
 	return 0;
-- 
2.34.1


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

* Re: [PATCH] bus/platform: fix use after free
  2023-08-24 10:52 [PATCH] bus/platform: fix use after free Tomasz Duszynski
@ 2023-10-02  8:34 ` David Marchand
  0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2023-10-02  8:34 UTC (permalink / raw)
  To: Tomasz Duszynski; +Cc: dev, jerinj, thomas

On Thu, Aug 24, 2023 at 12:52 PM Tomasz Duszynski
<tduszynski@marvell.com> wrote:
>
> Remove device from the list before doing actual cleanup to avoid use
> after free.
>
> Bugzilla ID: 1276
> Fixes: 17c839f74da3 ("bus: add platform bus")
>
> Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2023-10-02  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-24 10:52 [PATCH] bus/platform: fix use after free Tomasz Duszynski
2023-10-02  8:34 ` David Marchand

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