phy: qcom: qmp-usb: 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: 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 Qualcomm QMP USB PHY driver can dereference an uninitialized pointer if runtime suspend runs during early initialization. This can crash the kernel; it may also occur if a local user re-enables runtime power management through sysfs before the PHY is initialized. The input does not specify authentication requirements.
Engineers running Linux kernels with the Qualcomm QMP USB PHY driver should check their kernel versions; affected versions are not specified.