Skip to contentSkip to conversation

platform bus use after free

Bug 1276 [email protected] 1 participant 2 messages Aug 22, 2023 – Oct 2, 2023

lore
Share & tools
lore
#0 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=1276

            Bug ID: 1276
           Summary: platform bus use after free
           Product: DPDK
           Version: 23.07
          Hardware: ARM
                OS: Linux
            Status: UNCONFIRMED
          Severity: critical
          Priority: Normal
         Component: ethdev
          Assignee: [email protected]
          Reporter: [email protected]

Target Milestone: ---

After I register a platform driver, a segment fault occurs when the program call rte_eal_cleanup.
The code that causes this problem is at drivers/bus/platform/platform.c:615, as follows:
static int
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);
        }

        return 0;
}
To fix this, modify it as follows:
static int
platform_bus_cleanup(void)
{
        struct rte_platform_device *pdev, *tmp;

        RTE_TAILQ_FOREACH_SAFE(pdev, &platform_bus.device_list, next, tmp) {
                TAILQ_REMOVE(&platform_bus.device_list, pdev, next);
                platform_bus_unplug(&pdev->device);
        }

        return 0;
}

I'm lazy, that's all.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.
#1 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=1276

David Marchand ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|CONFIRMED                   |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |FIXED

--- Comment #2 from David Marchand ([email protected]) --- Fixed in d780011158ea ("bus/platform: fix bus cleanup"). Thanks.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.