{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38421","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T04:51:24.014Z","datePublished":"2025-07-25T14:16:42.409Z","dateUpdated":"2026-08-05T12:01:44.968Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:01:44.968Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nplatform/x86/amd: pmf: Use device managed allocations\n\nIf setting up smart PC fails for any reason then this can lead to\na double free when unloading amd-pmf.  This is because dev->buf was\nfreed but never set to NULL and is again freed in amd_pmf_remove().\n\nTo avoid subtle allocation bugs in failures leading to a double free\nchange all allocations into device managed allocations."}],"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 amd-pmf platform driver is reachable only from the local machine — via driver unbind/module unload, the suspend/resume PM path, or the debugfs `update_policy` handler. There is no network or adjacent-network exposure.\nAC:L - On an affected system (AMD laptop whose BIOS advertises Smart PC while the PMF TA/policy is unavailable) `amd_pmf_init_smart_pc()` fails deterministically at every boot, leaving `dev->buf`, `dev->policy_buf` and `dev->prev_data` dangling, so the attacker simply triggers unbind or a suspend/resume cycle to hit the double free/UAF with 100% reliability.\nPR:L - The dangling `pdev->buf` is dereferenced from `amd_pmf_resume_handler()`/`amd_pmf_restore_handler()` and from the re-armed `pb_work` handler, and an unprivileged local user in an active session can initiate suspend/resume through logind; heap grooming to control the reused slab object also needs only unprivileged allocations.\nUI:N - The attacker performs the triggering action themselves (driver unbind/module unload or a suspend/resume cycle); no separate victim needs to be induced into any action.\nS:U - The corrupted memory and the resulting privilege escalation are entirely within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The stale `dev->buf`/`dev->prev_data` pointers are read after free (`memcpy(&dev->m_table, dev->buf, dev->mtable_size)` in `amd_pmf_get_smu_info()`), leaking reallocated kernel slab contents, and the double free gives the attacker a slab object shared with another subsystem, which is a general kernel-memory read primitive.\nI:H - The double free of `dev->buf` (and of `policy_buf`/`prev_data`) lets the same slab object be handed to two owners, and the UAF write paths (`memset(dev->buf, 0, dev->mtable_size)`, `dev->prev_data->spl = val`, plus SMU DMA into the freed page programmed by `amd_pmf_set_dram_addr()`) provide a controlled write into live kernel objects, which is exploitable for control-flow hijack.\nA:H - A double free triggers immediate slab freelist corruption — a BUG/panic under freelist hardening or CONFIG_SLUB_DEBUG, and unbounded heap corruption leading to a crash otherwise; the UAF accesses from the PM resume path can be repeated to reliably crash the system."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/platform/x86/amd/pmf/core.c","drivers/platform/x86/amd/pmf/tee-if.c"],"versions":[{"version":"5b1122fc4995f308b21d7cfc64ef9880ac834d20","lessThan":"0d10b532f861253c283863522d59d099fcb0796d","status":"affected","versionType":"git"},{"version":"5b1122fc4995f308b21d7cfc64ef9880ac834d20","lessThan":"d9db3a941270d92bbd1a6a6b54a10324484f2f2d","status":"affected","versionType":"git"},{"version":"e70b4b8f93d7fcf8ee063a1d1f18782c4da3d335","status":"affected","versionType":"git"},{"version":"3ed60e51ffdbfef14169bd967e21a6ba5e5ff42b","status":"affected","versionType":"git"},{"version":"6.12.23","lessThan":"6.13","status":"affected","versionType":"semver"},{"version":"6.13.11","lessThan":"6.14","status":"affected","versionType":"semver"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/platform/x86/amd/pmf/core.c","drivers/platform/x86/amd/pmf/tee-if.c"],"versions":[{"version":"6.14","status":"affected"},{"version":"0","lessThan":"6.14","status":"unaffected","versionType":"semver"},{"version":"6.15.4","lessThanOrEqual":"6.15.*","status":"unaffected","versionType":"semver"},{"version":"6.16","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.14","versionEndExcluding":"6.15.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.14","versionEndExcluding":"6.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12.23"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.13.11"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/0d10b532f861253c283863522d59d099fcb0796d"},{"url":"https://git.kernel.org/stable/c/d9db3a941270d92bbd1a6a6b54a10324484f2f2d"}],"title":"platform/x86/amd: pmf: Use device managed allocations","x_generator":{"engine":"bippy-1.2.0"}}}}