CVE-2026-93251: ACPI: bus: Introduce acpi_bus_get_primary_device()
In the Linux kernel, the following vulnerability has been resolved:
ACPI: bus: Introduce acpibusgetprimarydevice()
The function used for obtaining the first "physical" device for which the given ACPI one is the ACPI companion, acpigetfirstphysicalnode(), may return a stale device pointer (mostly in theory) because acpiunbindone() may run as a whole after dropping the ACPI device's physicalnodelock in acpigetfirstphysicalnode() and before it returns. The last reference to the "physical" device may be dropped then before the pointer to it is returned to the caller.
If that happens and the acpigetfirstphysicalnode() caller invokes getdevice() on the pointer obtained from it, which is done by the majority of its callers, a use-after-free will occur.
To prepare for addressing this problem, introduce a new function for getting the first "physical" device associated with the given ACPI one (the "primary physical device") that will also reference count the device in question before returning a pointer to it.
Make that new function and acpigetfirstphysicalnode() share the physical node list lookup code.
No intentional functional impact.
Affected Software
Event History
Frequently Asked Questions
What race condition is addressed by this change?
A caller can obtain a physical-device pointer from acpi_get_first_physical_node() after the ACPI device lock has been released. acpi_unbind_one() may then complete and drop the final reference to that physical device before the caller invokes get_device(), resulting in a use-after-free.
Which code paths are most relevant to the issue?
The issue affects callers of acpi_get_first_physical_node() that subsequently call get_device() on the returned pointer, which the description says is the majority of its callers. The new acpi_bus_get_primary_device() function obtains a reference before returning the primary physical-device pointer.
How does the resolved implementation prevent the use-after-free?
It introduces acpi_bus_get_primary_device(), which reference-counts the associated primary physical device before returning it to the caller. This prevents the device from being freed in the interval between list lookup and the caller acquiring its own reference.