firmware: arm_scmi: Drop handle on protocol bind failures
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 971fc0665f1361f23251e4d85fac4aed1b683505 · < e3a5c30d233ca5d3e799a80da806554c703bda13| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
firmware: arm_scmi: Drop handle on protocol bind failures
The SCMI bus notifier acquires an SCMI handle when the driver core emits BUS_NOTIFY_BIND_DRIVER, before invoking the protocol driver probe callback. The protocol probe path only checks whether sdev->handle is set.
If device_link_add() fails after the handle has been acquired, the protocol device can still bind with a valid handle but without the dependency link to the SCMI parent. A concurrent parent unbind can then miss the child and tear down the SCMI instance while the child still holds a handle into it.
If the protocol driver probe later fails, for example with -EPROBE_DEFER, the driver core emits BUS_NOTIFY_DRIVER_NOT_BOUND rather than BUS_NOTIFY_UNBOUND_DRIVER. The SCMI notifier only released the handle on BUS_NOTIFY_UNBOUND_DRIVER, so each failed protocol-device bind leaked the SCMI instance users refcount and left sdev->handle set after the failed probe.
Make the link helper report failure and drop the acquired handle if the link cannot be created. Also handle BUS_NOTIFY_DRIVER_NOT_BOUND in the same cleanup path used for unbind so failed probes balance the earlier BUS_NOTIFY_BIND_DRIVER acquisition.
From the CVE record · Linux
The Linux kernel’s SCMI bus notifier can retain a handle after a protocol driver probe fails, leaking an SCMI instance reference. If device_link_add() fails, a concurrent parent unbind can also tear down the SCMI instance while a child still holds a handle to it. The input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with the arm_scmi firmware driver should check their versions; affected versions are not specified.