[Bug 1276] platform bus use after free

bugzilla at dpdk.org bugzilla at dpdk.org
Tue Aug 22 08:22:06 CEST 2023


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: dev at dpdk.org
          Reporter: 869119842 at qq.com
  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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20230822/3858cf02/attachment.htm>


More information about the dev mailing list