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.
Published: 2026-04-22
Score: n/a
EPSS: n/a
KEV: No
Impact: Denial of Service / Local Privilege Escalation
Action: Patch Immediately
AI Analysis

Impact

A memory management flaw in the Linux kernel’s ASoC audio subsystem allows a double free of device‑managed data allocated by devm_kzalloc(). The original cleanup loop incorrectly called kfree(), which can trigger a second free when the device’s resource allocator later releases the same memory. This vulnerability may cause a crash of the audio driver or, in a worst case scenario, arbitrary code execution with kernel‑level privileges. The description states that the bug was fixed by removing the manual kfree loop and delegating cleanup to devres.*

Affected Systems

The vulnerability exists in the Linux kernel source tree. No specific kernel release or version is enumerated in the advisory; it applies to any kernel configuration that includes the sma1307 audio driver prior to the referenced commit that deletes the manual cleanup loop.

Risk and Exploitability

Because the change is internal to the kernel, exploitation requires that an attacker can trigger the audio driver’s error path, likely through crafted audio data or device interactions. No EPSS score is supplied, and the issue is not listed in the KEV catalog, but double‑free bugs in the kernel are generally considered high‑severity. Attackers with local privileges or those able to load the driver can potentially exploit it, making it a high‑risk vulnerability if a patched kernel is not in use.

Generated by OpenCVE AI on April 22, 2026 at 18:56 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest kernel release that contains commit 1a82c3272626db9006f4c2cad3adf2916417aed6 which removes the manual kfree cleanup loop
  • Verify that the sma1307 audio driver is either updated or disabled if the system remains on an older kernel
  • Audit system logs for repeated "device resource released" errors as an early indicator of an exploitation attempt

Generated by OpenCVE AI on April 22, 2026 at 18:56 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 23 Apr 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-763
References
Metrics threat_severity

None

threat_severity

Moderate


Wed, 22 Apr 2026 19:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Wed, 22 Apr 2026 14:15:00 +0000

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

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-04-22T13:54:04.113Z

Reserved: 2026-03-09T15:48:24.098Z

Link: CVE-2026-31475

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-04-22T14:16:44.207

Modified: 2026-04-22T14:16:44.207

Link: CVE-2026-31475

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-04-22T00:00:00Z

Links: CVE-2026-31475 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-22T19:00:08Z

Weaknesses