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 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.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.18.21, 6.19.11
- CVEs
- CVE-2026-31475
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 03:45 UTC · Revision 1
Source evidence
ASoC: sma1307: fix double free of devm_kzalloc() memory
core-osv · Original sourcePublished 22 Apr 2026, 13:54 UTC
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.
osv:CVE-2026-31475
Kernel
Fixed versions: 6.18.21, 6.19.11
Complete source record
{
"id": "9c4fb14f8e608de22f0131c135e1b0e229c2c17247274066c83cb8bc210c7a7b",
"url": "https://osv.dev/vulnerability/CVE-2026-31475",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "ASoC: sma1307: fix double free of devm_kzalloc() memory",
"summary": "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.",
"evidence": "osv:CVE-2026-31475",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.18.21",
"evidence": "/affected/1/ranges"
},
{
"value": "6.19.11",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2026-31475",
"aliases": [
"CVE-2026-31475"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "0ec6bd16705fe21d6429d6b8f7981eae2142bba8"
},
{
"fixed": "d472d1a52985211b92883bb64bbe710b45980190"
},
{
"fixed": "1a82c3272626db9006f4c2cad3adf2916417aed6"
},
{
"fixed": "fe757092d2329c397ecb32f2bf68a5b1c4bd9193"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "6.14.9"
},
{
"fixed": "6.15"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "f8434b8ba437d3f6cbcd9ffe8405bd16ed28fc5c"
}
]
}
],
"versions": [
"v6.14.11",
"v6.14.10",
"v6.14.9"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31475.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.15.0"
},
{
"fixed": "6.18.21"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.19.0"
},
{
"fixed": "6.19.11"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31475.json"
}
}
],
"modified": "2026-10-28T02:30:25.784457994Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/1a82c3272626db9006f4c2cad3adf2916417aed6",
"https://git.kernel.org/stable/c/d472d1a52985211b92883bb64bbe710b45980190",
"https://git.kernel.org/stable/c/fe757092d2329c397ecb32f2bf68a5b1c4bd9193",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31475.json",
"https://nvd.nist.gov/vuln/detail/CVE-2026-31475",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31475.json"
}
},
"related_cves": [
{
"value": "CVE-2026-31475",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 492258,
"published_at": "2026-04-22T13:54:04.113+00:00"
}