{"id":"CVE-2025-38424","state":"PUBLISHED","title":"perf: Fix sample vs do_exit()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix sample vs do_exit()\n\nBaisheng Gao reported an ARM64 crash, which Mark decoded as being a\nsynchronous external abort -- most likely due to trying to access\nMMIO in bad ways.\n\nThe crash further shows perf trying to do a user stack sample while in\nexit_mmap()'s tlb_finish_mmu() -- i.e. while tearing down the address\nspace it is trying to access.\n\nIt turns out that we stop perf after we tear down the userspace mm; a\nreceipie for disaster, since perf likes to access userspace for\nvarious reasons.\n\nFlip this order by moving up where we stop perf in do_exit().\n\nAdditionally, harden PERF_SAMPLE_CALLCHAIN and PERF_SAMPLE_STACK_USER\nto abort when the current task does not have an mm (exit_mm() makes\nsure to set current->mm = NULL; before commencing with the actual\nteardown). Such that CPU wide events don't trip on this same problem.","publishedAt":"2025-07-25T14:16:44.846Z","updatedAt":"2026-10-15T21:52:15.805Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"7b8f3c72175c6a63a95cf2e219f8b78e2baad34e","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"507c9a595bad3abd107c6a8857d7fd125d89f386","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"a9f6aab7910a0ef2895797f15c947f6d1053160f","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"975ffddfa2e19823c719459d2364fcaa17673964","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"2ee6044a693735396bb47eeaba1ac3ae26c1c99b","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"456019adaa2f5366b89c868dea9b483179bece54","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"7311970d07c4606362081250da95f2c7901fc0db","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"4f6fc782128355931527cefe3eb45338abd8ab39","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/events/core.c","kernel/exit.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","versionType":"semver"},{"version":"5.4.295","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.239","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.186","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.142","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.95","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.35","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.4","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/events/core.c","kernel/exit.c"]}],"references":["https://git.kernel.org/stable/c/7b8f3c72175c6a63a95cf2e219f8b78e2baad34e","https://git.kernel.org/stable/c/507c9a595bad3abd107c6a8857d7fd125d89f386","https://git.kernel.org/stable/c/a9f6aab7910a0ef2895797f15c947f6d1053160f","https://git.kernel.org/stable/c/975ffddfa2e19823c719459d2364fcaa17673964","https://git.kernel.org/stable/c/2ee6044a693735396bb47eeaba1ac3ae26c1c99b","https://git.kernel.org/stable/c/456019adaa2f5366b89c868dea9b483179bece54","https://git.kernel.org/stable/c/7311970d07c4606362081250da95f2c7901fc0db","https://git.kernel.org/stable/c/4f6fc782128355931527cefe3eb45338abd8ab39","https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/38xxx/CVE-2025-38424.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38424","state":"PUBLISHED","datePublished":"2025-07-25T14:16:44.846Z","dateUpdated":"2026-10-15T21:52:15.805Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:24.014Z"},"containers":{"cna":{"title":"perf: Fix sample vs do_exit()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix sample vs do_exit()\n\nBaisheng Gao reported an ARM64 crash, which Mark decoded as being a\nsynchronous external abort -- most likely due to trying to access\nMMIO in bad ways.\n\nThe crash further shows perf trying to do a user stack sample while in\nexit_mmap()'s tlb_finish_mmu() -- i.e. while tearing down the address\nspace it is trying to access.\n\nIt turns out that we stop perf after we tear down the userspace mm; a\nreceipie for disaster, since perf likes to access userspace for\nvarious reasons.\n\nFlip this order by moving up where we stop perf in do_exit().\n\nAdditionally, harden PERF_SAMPLE_CALLCHAIN and PERF_SAMPLE_STACK_USER\nto abort when the current task does not have an mm (exit_mm() makes\nsure to set current->mm = NULL; before commencing with the actual\nteardown). Such that CPU wide events don't trip on this same problem."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"7b8f3c72175c6a63a95cf2e219f8b78e2baad34e","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"507c9a595bad3abd107c6a8857d7fd125d89f386","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"a9f6aab7910a0ef2895797f15c947f6d1053160f","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"975ffddfa2e19823c719459d2364fcaa17673964","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"2ee6044a693735396bb47eeaba1ac3ae26c1c99b","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"456019adaa2f5366b89c868dea9b483179bece54","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"7311970d07c4606362081250da95f2c7901fc0db","versionType":"git"},{"version":"c5ebcedb566ef17bda7b02686e0d658a7bb42ee7","status":"affected","lessThan":"4f6fc782128355931527cefe3eb45338abd8ab39","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/events/core.c","kernel/exit.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","versionType":"semver"},{"version":"5.4.295","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.239","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.186","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.142","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.95","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.35","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.4","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/events/core.c","kernel/exit.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/7b8f3c72175c6a63a95cf2e219f8b78e2baad34e"},{"url":"https://git.kernel.org/stable/c/507c9a595bad3abd107c6a8857d7fd125d89f386"},{"url":"https://git.kernel.org/stable/c/a9f6aab7910a0ef2895797f15c947f6d1053160f"},{"url":"https://git.kernel.org/stable/c/975ffddfa2e19823c719459d2364fcaa17673964"},{"url":"https://git.kernel.org/stable/c/2ee6044a693735396bb47eeaba1ac3ae26c1c99b"},{"url":"https://git.kernel.org/stable/c/456019adaa2f5366b89c868dea9b483179bece54"},{"url":"https://git.kernel.org/stable/c/7311970d07c4606362081250da95f2c7901fc0db"},{"url":"https://git.kernel.org/stable/c/4f6fc782128355931527cefe3eb45338abd8ab39"}],"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 vulnerability is reached through the `perf_event_open(2)` syscall creating a sampling event with `PERF_SAMPLE_STACK_USER`/`PERF_SAMPLE_CALLCHAIN`, plus a normal task exit. No network or physical component is involved.\nAC:L - The attacker controls both sides of the race — it creates the sampling event, chooses when the task calls `exit_group()`, and can widen the `exit_mmap()` window arbitrarily by mapping a large address space with many VMAs; failed attempts are free and can be repeated thousands of times per second via forked children with `attr.inherit=1`.\nPR:L - An ordinary unprivileged user can do this at the upstream default `perf_event_paranoid=2` — `PERF_SAMPLE_STACK_USER`/`PERF_SAMPLE_CALLCHAIN` have no capability gate, per-task events on one's own tasks need only `ptrace_may_access`, and `exclude_kernel=1` samples that skid into kernel mode are deliberately not dropped (revert 6a8a75f32357; `sample_is_allowed()` only guards `sigtrap`). On the widely deployed `perf_event_paranoid<=1` systems it is fully deterministic with software clock events.\nUI:N - The attacker triggers everything from its own processes — open the event, exit the task. No victim action, no privileged profiler, and no administrator involvement is required.\nS:U - The unsafe access and its consequences are contained within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `__copy_from_user_inatomic()`/`__get_user()` read through an mm whose data pages and page-table pages have already been freed and can be reallocated, and the harvested bytes are written verbatim into the attacker-readable perf ring buffer — a use-after-free read that can disclose freed/reused memory or, via a walk through a recycled page-table page, effectively arbitrary physical memory.\nI:H - The use-after-free on the page tables makes the CPU issue accesses to attacker-groomable, arbitrary physical addresses; per UAF scoring guidance this is High, and it is concretely damaging because the reported case lands on MMIO, where reads carry side effects (read-to-clear status, FIFO pops) that corrupt device and system state.\nA:H - The reported failure is a fatal kernel abort — on arm64 `do_sea()` routes the synchronous external abort to `arm64_notify_die()` with `SIGKILL/SI_KERNEL`, which in kernel mode is an unrecoverable oops/panic; the attacker can trigger it repeatedly, giving a reliable full system DoS."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:01:47.114Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.4.295"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.10.239"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.15.186"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.1.142"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.6.95"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.12.35"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.15.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.16"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T17:37:54.380Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2025-38424","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-15T21:50:16.738401Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T21:52:15.805Z"}}]}}}