phy: qcom: qmp-usb-legacy: Fix possible NULL-deref on early runtime suspend
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
phy: qcom: qmp-usb-legacy: Fix possible NULL-deref on early runtime suspend
There is a small window where the runtime suspend callback may run after pm_runtime_enable() and before pm_runtime_forbid(). In this case, a crash occurs because runtime suspend/resume dereferences qmp->phy pointer, which is not yet initialized: `if (!qmp->phy->init_count) {`
This can also happen if user re-enables runtime-pm via the sysfs attribute before qmp phy is initialized.
Similarly to other qcom phy drivers, introduce a qmp->phy_initialized variable that can be used to avoid relying on the possibly uninitialized phy pointer.
From the CVE record · Linux
The Linux kernel’s qcom qmp-usb-legacy PHY driver can dereference an uninitialized pointer if runtime suspend runs during early initialization, causing a crash. This can happen in a timing window without user interaction, or if a local user re-enables runtime power management through sysfs before the PHY is initialized; the input does not specify whether authentication is required.
Teams running Linux kernels with the qcom qmp-usb-legacy PHY driver should check their kernel vendor’s advisory; affected versions are not specified.