ASoC: mediatek: mt8365-afe-pcm: fix possible NULL-pointer dereferences in mt8365_afe_suspend()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.12.1116.18.537.2In the Linux kernel, the following vulnerability has been resolved:
ASoC: mediatek: mt8365-afe-pcm: fix possible NULL-pointer dereferences in mt8365_afe_suspend()
mt8365_afe_suspend() allocates the register backup buffer with devm_kcalloc(), but does not check for allocation failure before using the returned pointer. This may lead to a NULL pointer dereference when accessing afe->reg_back_up[i].
Add the missing NULL check and return -ENOMEM on allocation failure after disabling the main clock.
Also propagate the return value of mt8365_afe_suspend() in mt8365_afe_dev_runtime_suspend() so that the suspended state is not updated when suspend fails.
From the CVE record · Linux
The Linux kernel’s mt8365 ASoC suspend function can dereference a NULL pointer if allocation of a register backup buffer fails. The input does not establish whether an attacker can trigger this condition, or specify any access or user-interaction requirements.
Engineers running Linux kernels with the mt8365 ASoC driver should check their versions; affected versions are not specified.