{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-39935",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T07:20:57.148Z",
        "datePublished": "2025-10-04T07:30:59.102Z",
        "dateUpdated": "2026-08-05T12:06:13.802Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:06:13.802Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nASoC: codec: sma1307: Fix memory corruption in sma1307_setting_loaded()\n\nThe sma1307->set.header_size is how many integers are in the header\n(there are 8 of them) but instead of allocating space of 8 integers\nwe allocate 8 bytes.  This leads to memory corruption when we copy data\nit on the next line:\n\n        memcpy(sma1307->set.header, data,\n               sma1307->set.header_size * sizeof(int));\n\nAlso since we're immediately copying over the memory in ->set.header,\nthere is no need to zero it in the allocator.  Use devm_kmalloc_array()\nto allocate the memory instead."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7.8,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The vulnerable code is reached through a local ALSA mixer control write (`SNDRV_CTL_IOCTL_ELEM_WRITE` on `/dev/snd/controlC*` → `sma1307_reset_put()` → `sma1307_reset()` → `sma1307_setting_loaded()`), or at driver probe on an I2C-attached codec. There is no network or adjacent-network reachability.\nAC:L - The mismatch is unconditional — `devm_kzalloc(dev, 8)` followed by a 32-byte `memcpy` overflows on every single settings load, with no race, no timing window, and no memory-layout precondition. The attacker can re-trigger it arbitrarily many times via the \"Reset Switch\" control, and the accompanying devres leak provides repeatable heap grooming.\nPR:L - Triggering requires only write access to the sound control device (`root:audio 0660`, plus logind ACL for the active session user; the audio server on Android) — an ordinary unprivileged local account, with no capability check anywhere along `snd_ctl_elem_write()` → `sma1307_reset_put()`.\nUI:N - The attacker writes the mixer control directly from their own process; no victim action, no file open, and no administrator step is needed. The probe-time path also fires automatically at boot.\nS:U - The out-of-bounds write corrupts kernel slab memory within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The `memcpy` reads 32 bytes from a `kzalloc(fw->size)` buffer that may be as small as 8 bytes, disclosing up to 24 bytes of adjacent kernel heap into `set.header` (readable back through the driver's binary/register paths). More broadly, an adjacent-slab-object overwrite of SLUB freelist metadata is a well-established route to an arbitrary kernel read primitive.\nI:H - This is a 24-byte heap buffer overflow that writes past the `kmalloc-64` devres object into the neighbouring slab allocation, corrupting whatever kernel object or SLUB freelist pointer sits there. Combined with the repeatable-allocation grooming primitive, this is exploitable for controlled memory corruption and privilege escalation, especially where the firmware file content is attacker-influenceable.\nA:H - Slab corruption of an adjacent object reliably produces oopses/panics (immediate KASAN slab-out-of-bounds report on instrumented kernels), and each \"Reset Switch\" write additionally leaks devres allocations for `header`, `def`, and all `mode_set[]` entries without freeing the previous ones, allowing an unprivileged user to exhaust kernel memory."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "sound/soc/codecs/sma1307.c"
                    ],
                    "versions": [
                        {
                            "version": "576c57e6b4c1d734bcb7cc33dde9a99a9383b520",
                            "lessThan": "cd59ca8f75dbb42a67fcae975c766114644e36c4",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "576c57e6b4c1d734bcb7cc33dde9a99a9383b520",
                            "lessThan": "78338108b5a856dc98223a335f147846a8a18c51",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "sound/soc/codecs/sma1307.c"
                    ],
                    "versions": [
                        {
                            "version": "6.13",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.13",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.16.9",
                            "lessThanOrEqual": "6.16.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.17",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.13",
                                    "versionEndExcluding": "6.16.9"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.13",
                                    "versionEndExcluding": "6.17"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/cd59ca8f75dbb42a67fcae975c766114644e36c4"
                },
                {
                    "url": "https://git.kernel.org/stable/c/78338108b5a856dc98223a335f147846a8a18c51"
                }
            ],
            "title": "ASoC: codec: sma1307: Fix memory corruption in sma1307_setting_loaded()",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}