CVE-2026-31475: ASoC: sma1307: fix double free of devm_kzalloc() memory
In the Linux kernel, the following vulnerability has been resolved:
ASoC: sma1307: fix double free of devmkzalloc() memory
A previous change added NULL checks and cleanup for allocation failures in sma1307settingloaded().
However, the cleanup for modeset entries is wrong. Those entries are allocated with devmkzalloc(), 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
In sma1307_setting_loaded() error path, remove the manual kfree() loop for mode_set entries; those entries are allocated with devm_kzalloc() and must not be freed with kfree(). Let devres (device-managed cleanup) release them.
ASoC sma1307 driver Error-path cleanup for mode_set entries allocated with devm_kzalloc() = Do not manually free (remove kfree())
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31475?
CVE-2026-31475 has a severity score of 7.8, which is classified as high.
How do I fix CVE-2026-31475?
To fix CVE-2026-31475, update the Linux kernel to the latest version where the vulnerability has been resolved.
What type of vulnerability is CVE-2026-31475?
CVE-2026-31475 is categorized as a Double Free vulnerability.
Which software is affected by CVE-2026-31475?
CVE-2026-31475 affects the Linux kernel and specifically the Linux ASoC sma1307 driver.
What is the potential impact of CVE-2026-31475?
The potential impact of CVE-2026-31475 includes memory corruption leading to denial of service or code execution.