ASoC: sma1307: fix double free of devm_kzalloc() memory
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.15
|
In the Linux kernel, the following vulnerability has been resolved:
ASoC: sma1307: fix double free of devm_kzalloc() memory
A previous change added NULL checks and cleanup for allocation failures in sma1307_setting_loaded().
However, the cleanup for mode_set entries is wrong. Those entries are allocated with devm_kzalloc(), so they are device-managed resources and must not be freed with kfree(). Manually freeing them in the error path can lead to a double free when devres later releases the same memory.
Drop the manual kfree() loop and let devres handle the cleanup.
From the CVE record · Linux
The Linux kernel’s ASoC sma1307 driver can double-free device-managed memory when allocation fails during sma1307_setting_loaded() cleanup. The input does not establish how an attacker could trigger this condition or whether access or user interaction is required.
Engineers running Linux kernels with the ASoC sma1307 driver should check their versions; affected versions were not provided.