drm/msm/dp: Drop aux devices together with DP controller
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/msm/dp: Drop aux devices together with DP controller
Using devres to depopulate the aux bus made sure that upon a probe deferral the EDP panel device would be destroyed and recreated upon next attempt.
But the struct device which the devres is tied to is the DPUs (drm_dev->dev), which may be happen after the DP controller is torn down.
Indications of this can be seen in the commonly seen EDID-hexdump full of zeros in the log, or the occasional/rare KASAN fault where the panel's attempt to read the EDID information causes a use after free on DP resources.
It's tempting to move the devres to the DP controller's struct device, but the resources used by the device(s) on the aux bus are explicitly torn down in the error path. The KASAN-reported use-after-free also remains, as the DP aux "module" explicitly frees its devres-allocated memory in this code path.
As such, explicitly depopulate the aux bus in the error path, and in the component unbind path, to avoid these issues.
Patchwork: https://patchwork.freedesktop.org/patch/542163/
From the CVE record · Linux
The Linux kernel's drm/msm/dp driver can leave auxiliary-bus devices in place after the DP controller is torn down. During probe deferral or component unbind, a panel's EDID read can then cause a use-after-free on DP resources. The input does not establish an attacker path, authentication requirement, or user interaction requirement.
Engineers running Linux kernels with the drm/msm/dp driver should check whether their kernel includes the fix; affected versions are not specified.