CVE-2026-31475

ASoC: sma1307: fix double free of devm_kzalloc() memory

Published Apr 22, 2026 CVSS 3.1 · 7.8 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

A memory‑management flaw was discovered in the Linux kernel’s Advanced Sound Architecture (ASoC) driver for the sma1307 audio codec. The bug arises when the driver attempts to free device‑managed memory allocated with devm_kzalloc() via a manual kfree() loop during error handling. Because devm_kzalloc() memory is automatically freed by the device‑resource allocator, the manual kfree causes a double‑free (CWE-415). This misuse also violates device‑resource management best practices (CWE-763). A double‑free can corrupt kernel memory, potentially leading to a kernel panic or other unintended behavior, but there is no documented evidence that it can be leveraged for privilege escalation.

Affected Systems

Affected systems run Linux kernel versions that include the sma1307 driver before the revert commit. The vulnerability is present in kernel 6.15 and all 7.0 release candidates up to rc7. Any system that has the sma1307 driver enabled and is running a kernel before the applied patch is susceptible. Systems using more recent stable kernels that incorporate the fix are not affected.

Risk and Exploitability

The CVSS score of 7.8 reflects high severity, while the EPSS score of < 1 % indicates a low likelihood of exploitation in the wild. The issue is not currently listed in the CISA KEV catalog. Exploitation requires the attacker to trigger the driver’s error path, which generally necessitates local presence or the ability to load the driver. Once triggered, it can lead to a kernel panic, service disruption, or other unintended behavior. Administrators should treat it as a high‑risk local vulnerability.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a release that integrates commit 1a82c3272626db9006f4c2cad3adf2916417aed6, such as the latest 6.15 or 7.0 release that contains the fix.
  • If the sma1307 audio codec is not required, disable or unload the driver to remove the attack surface.
  • Continuously monitor kernel logs (e.g., dmesg) for indications of double‑free, kfree errors, or unexpected crashes that could signal an attempted exploitation.

Generated by OpenCVE AI on April 29, 2026 at 00:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Weaknesses CWE-415
CPEs cpe:2.3:o:linux:linux_kernel:6.15:-:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc7:*:*:*:*:*:*
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description 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.
Title ASoC: sma1307: fix double free of devm_kzalloc() memory
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Aug 5, 2026, 12:22 PM
Reserved
Mar 9, 2026, 3:48 PM
Status
Analyzed
Published
Apr 22, 2026, 2:16 PM
Modified
Nov 11, 2026, 11:10 PM
Severity
Moderate
Public date
Apr 22, 2026, 12:00 AM