ACPI: bus: Introduce acpi_bus_get_primary_device()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 91e5687805885f9fceb60b95e950a3d3bdcf4764 · < 72530e1f72b0515a73fd88292254d04fecf03649| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ACPI: bus: Introduce acpi_bus_get_primary_device()
The function used for obtaining the first "physical" device for which the given ACPI one is the ACPI companion, acpi_get_first_physical_node(), may return a stale device pointer (mostly in theory) because acpi_unbind_one() may run as a whole after dropping the ACPI device's physical_node_lock in acpi_get_first_physical_node() 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 acpi_get_first_physical_node() caller invokes get_device() 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 acpi_get_first_physical_node() share the physical node list lookup code.
No intentional functional impact.
From the CVE record · Linux
The Linux kernel's ACPI device lookup can return a stale physical-device pointer if device unbinding races with the lookup. A caller that then accesses the freed device can trigger a use-after-free. The input does not specify an attack method, authentication requirement, or user interaction.
Engineers running Linux kernels with the affected ACPI device lookup should check their versions; affected versions are not specified.