firmware: arm_scmi: Fix SCMI device destroy lifetimes
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9ca67840c0ddf3f39407339624cef824a4f27599 · < 6abe8fe36b29ff51d1a42c2f338972883f4751a5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
firmware: arm_scmi: Fix SCMI device destroy lifetimes
scmi_child_dev_find() drops the reference returned by device_find_child() before returning the scmi_device pointer. A concurrent unregister can then release the device while the destroy path is still using the returned pointer.
Make the lookup helper return the device_find_child() reference and keep it until scmi_device_destroy() has finished unregistering the child.
Also split device_unregister() in __scmi_device_destroy() so the SCMI bus ID is not made reusable until after device_del() has removed the old scmi_dev.N name from sysfs. This avoids a new SCMI device reusing the same ID while the old device is still registered.
The final device release callback is also a possible cleanup path when SCMI children are deleted by driver core recursion rather than __scmi_device_destroy(). Release the SCMI bus ID from a common helper used by destroy, register-failure and final-release paths, and clear scmi_dev->id after freeing it so the final release cannot free the same ID again.
From the CVE record · Linux
The Linux kernel’s ARM SCMI device-destruction path can use a device pointer after a concurrent unregister releases it. The path can also make an SCMI bus ID reusable before the old device is removed from sysfs. The input does not specify an attack route, authentication requirement, or user interaction.
Engineers running Linux kernels with ARM SCMI support should check their kernel versions; affected versions are not specified.