cpufreq: governor: fix double free in cpufreq_dbs_governor_init() error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4ebe36c94aed95de71a8ce6a6762226d31c938ee · < d2703b4f8fb7cc6f0dfdb2dc2359cc46189e7357| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
cpufreq: governor: fix double free in cpufreq_dbs_governor_init() error path
When kobject_init_and_add() fails, cpufreq_dbs_governor_init() calls kobject_put(&dbs_data->attr_set.kobj).
The kobject release callback cpufreq_dbs_data_release() calls gov->exit(dbs_data) and kfree(dbs_data), but the current error path then calls gov->exit(dbs_data) and kfree(dbs_data) again, causing a double free.
Keep the direct kfree(dbs_data) for the gov->init() failure path, but after kobject_init_and_add() has been called, let kobject_put() handle the cleanup through cpufreq_dbs_data_release().
From the CVE record · Linux
The Linux kernel’s cpufreq governor has a double free in the cpufreq_dbs_governor_init() error path when kobject_init_and_add() fails. The input does not establish how an attacker could trigger the failure or whether access, authentication, or user interaction is required.
Engineers running the Linux kernel should check their builds; affected versions are not specified.