Input: mtk-pmic-keys - fix possible null pointer dereference
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:
Input: mtk-pmic-keys - fix possible null pointer dereference
In mtk_pmic_keys_probe, the regs parameter is only set if the button is parsed in the device tree. However, on hardware where the button is left floating, that node will most likely be removed not to enable that input. In that case the code will try to dereference a null pointer.
Let's use the regs struct instead as it is defined for all supported platforms. Note that it is ok setting the key reg even if that latter is disabled as the interrupt won't be enabled anyway.
From the CVE record · Linux
The Linux kernel's mtk-pmic-keys driver can dereference a null pointer when a button is omitted from the device tree, as may happen when the button is left floating. This can cause a crash. The input does not establish an attack path, authentication requirement, or user-interaction requirement.
Engineers running Linux kernels with the mtk-pmic-keys driver should check configurations where a button is omitted from the device tree; affected versions are not specified.