pmdomain: mediatek: mfg: initialize prev_o in mtk_mfg_attach_dev()
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
pmdomain: mediatek: mfg: initialize prev_o in mtk_mfg_attach_dev()
mtk_mfg_attach_dev() reads prev_o on the first iteration of its loop, in "if (prev_o && prev_o->freq == o->freq)", before prev_o is assigned at the end of the loop body. On that first iteration, evaluating prev_o reads an indeterminate value. If it is non-NULL, the condition dereferences a stale or invalid pointer, potentially faulting or incorrectly skipping the first OPP.
Initialize prev_o to NULL. This matches the intent as well: there is no previous OPP to compare against on the first iteration.
Found with Clang's -Wconditional-uninitialized.
From the CVE record · Linux
The Linux kernel’s MediaTek MFG power-domain code reads an uninitialized pointer while attaching a device. On the first loop iteration, this can cause a fault or incorrectly skip the first operating performance point (OPP). The input does not specify an attack method or whether access, authentication, or user interaction is required.
Engineers running Linux kernels with the MediaTek MFG power-domain code should check their builds; affected versions are not specified.