CVE-2026-64377: cpufreq: qcom-cpufreq-hw: Fix possible double free
In the Linux kernel, the following vulnerability has been resolved:
cpufreq: qcom-cpufreq-hw: Fix possible double free
qcomcpufreq.data is allocated with devmkzalloc() in probe() as an array of per-domain data. qcomcpufreqhwcpuinit() stores a pointer to one element of this array in policy->driverdata.
qcomcpufreqhwcpuexit() currently calls kfree() on policy->driverdata. This is not valid because the memory is devm-managed. For the first domain, this can free the devm-managed allocation while the devres entry is still active, leading to a possible double free when the platform device is later detached. For other domains, the pointer may refer to an element inside the array rather than the allocation base.
Remove the kfree(data) call and let devres release qcomcpufreq.data.
This issue was found by a static analysis tool I am developing.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
In the qcom-cpufreq-hw code, remove the kfree(data) call (that double-frees devm-managed memory) and rely on devres/devm to free qcom_cpufreq.data when the device is detached.
Linux kernel (qcom-cpufreq-hw) Remove kfree(data) / rely on devres = Remove the explicit kfree(data) call in the driver and let devres release qcom_cpufreq.data (device-managed memory)