CVE-2025-38027: regulator: max20086: fix invalid memory access
In the Linux kernel, the following vulnerability has been resolved:
regulator: max20086: fix invalid memory access
max20086parseregulatorsdt() calls ofregulatormatch() using an array of struct ofregulatormatch allocated on the stack for the matches argument.
ofregulatormatch() calls devmofregulatorputmatches(), which calls devresalloc() to allocate a struct devmofregulatormatches which will be de-allocated using devmofregulatorputmatches().
struct devmofregulatormatches is populated with the stack allocated matches array.
If the device fails to probe, devmofregulatorputmatches() will be called and will try to call ofnodeput() on that stack pointer, generating the following dmesg entries:
max20086 6-0028: Failed to read DEVICEID reg: -121 kobject: '\xc0$\xa5\x03' (000000002cebcb7a): is not initialized, yet kobjectput() is being called.
Followed by a stack trace matching the call flow described above.
Switch to allocating the matches array using devmkcalloc() to avoid accessing the stack pointer long after it's out of scope.
This also has the advantage of allowing multiple max20086 to probe without overriding the data stored inside the global ofregulatormatch.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38027?
CVE-2025-38027 is considered a high severity vulnerability in the Linux kernel due to its potential for invalid memory access.
How do I fix CVE-2025-38027?
To mitigate CVE-2025-38027, update to the latest version of the Linux kernel that includes the patch for this vulnerability.
Which versions of the Linux kernel are affected by CVE-2025-38027?
CVE-2025-38027 affects various versions of the Linux kernel from 5.17 up to certain releases in the 6.x series.
What kind of vulnerability is CVE-2025-38027?
CVE-2025-38027 is a memory access vulnerability that can lead to crashes or potential data corruption in the Linux kernel.
Can CVE-2025-38027 be exploited remotely?
CVE-2025-38027 is mainly a local privilege escalation vulnerability and is not likely to be exploited remotely.