# CVE-2025-38520: drm/amdkfd: Don't call mmput from MMU notifier callback

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.20% (percentile 6, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-08-16T10:55:07.114Z
- **Modified:** 2026-06-17T09:17:02.067Z

## Who should check

- Anyone running Linux \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< c1bde9d48e09933c361521720f77a8072083c83a; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< 145a56bd68f4bff098d59fbc7c263d20dfef4fc4; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< e90ee15ce28c61f6d83a0511c3e02e2662478350; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< a7eb0a25010a674c8fdfbece38353ef7be8c5834; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< cf234231fcbc7d391e2135b9518613218cc5347f; 09c5cdbc62d99fc6306a21b24b60eb11a3bd0963; 4b29b8d7c20f54eec0ff266b4a3f419bd251ed83; \>= 5.15.49, \< 5.16; \>= 5.18.6, \< 5.19
- Anyone running Linux 5.19

## Description

In the Linux kernel, the following vulnerability has been resolved:

drm/amdkfd: Don't call mmput from MMU notifier callback

If the process is exiting, the mmput inside mmu notifier callback from
compactd or fork or numa balancing could release the last reference
of mm struct to call exit\_mmap and free\_pgtable, this triggers deadlock
with below backtrace.

The deadlock will leak kfd process as mmu notifier release is not called
and cause VRAM leaking.

The fix is to take mm reference mmget\_non\_zero when adding prange to the
deferred list to pair with mmput in deferred list work.

If prange split and add into pchild list, the pchild work\_item.mm is not
used, so remove the mm parameter from svm\_range\_unmap\_split and
svm\_range\_add\_child.

The backtrace of hung task:

 INFO: task python:348105 blocked for more than 64512 seconds.
 Call Trace:
  \_\_schedule+0x1c3/0x550
  schedule+0x46/0xb0
  rwsem\_down\_write\_slowpath+0x24b/0x4c0
  unlink\_anon\_vmas+0xb1/0x1c0
  free\_pgtables+0xa9/0x130
  exit\_mmap+0xbc/0x1a0
  mmput+0x5a/0x140
  svm\_range\_cpu\_invalidate\_pagetables+0x2b/0x40 \[amdgpu\]
  mn\_itree\_invalidate+0x72/0xc0
  \_\_mmu\_notifier\_invalidate\_range\_start+0x48/0x60
  try\_to\_unmap\_one+0x10fa/0x1400
  rmap\_walk\_anon+0x196/0x460
  try\_to\_unmap+0xbb/0x210
  migrate\_page\_unmap+0x54d/0x7e0
  migrate\_pages\_batch+0x1c3/0xae0
  migrate\_pages\_sync+0x98/0x240
  migrate\_pages+0x25c/0x520
  compact\_zone+0x29d/0x590
  compact\_zone\_order+0xb6/0xf0
  try\_to\_compact\_pages+0xbe/0x220
  \_\_alloc\_pages\_direct\_compact+0x96/0x1a0
  \_\_alloc\_pages\_slowpath+0x410/0x930
  \_\_alloc\_pages\_nodemask+0x3a9/0x3e0
  do\_huge\_pmd\_anonymous\_page+0xd7/0x3e0
  \_\_handle\_mm\_fault+0x5e3/0x5f0
  handle\_mm\_fault+0xf7/0x2e0
  hmm\_vma\_fault.isra.0+0x4d/0xa0
  walk\_pmd\_range.isra.0+0xa8/0x310
  walk\_pud\_range+0x167/0x240
  walk\_pgd\_range+0x55/0x100
  \_\_walk\_page\_range+0x87/0x90
  walk\_page\_range+0xf6/0x160
  hmm\_range\_fault+0x4f/0x90
  amdgpu\_hmm\_range\_get\_pages+0x123/0x230 \[amdgpu\]
  amdgpu\_ttm\_tt\_get\_user\_pages+0xb1/0x150 \[amdgpu\]
  init\_user\_pages+0xb1/0x2a0 \[amdgpu\]
  amdgpu\_amdkfd\_gpuvm\_alloc\_memory\_of\_gpu+0x543/0x7d0 \[amdgpu\]
  kfd\_ioctl\_alloc\_memory\_of\_gpu+0x24c/0x4e0 \[amdgpu\]
  kfd\_ioctl+0x29d/0x500 \[amdgpu\]

(cherry picked from commit a29e067bd38946f752b0ef855f3dfff87e77bec7)

## Affected and fixed versions

- Linux: \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< c1bde9d48e09933c361521720f77a8072083c83a; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< 145a56bd68f4bff098d59fbc7c263d20dfef4fc4; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< e90ee15ce28c61f6d83a0511c3e02e2662478350; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< a7eb0a25010a674c8fdfbece38353ef7be8c5834; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< cf234231fcbc7d391e2135b9518613218cc5347f; 09c5cdbc62d99fc6306a21b24b60eb11a3bd0963; 4b29b8d7c20f54eec0ff266b4a3f419bd251ed83; \>= 5.15.49, \< 5.16; \>= 5.18.6, \< 5.19 (cvelist)
- Linux: 5.19 (cvelist)

## Mitigation

- Upgrade Linux to 5.19 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38520. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38520.md
Affected: Linux >= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, < c1bde9d48e09933c361521720f77a8072083c83a; >= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, < 145a56bd68f4bff098d59fbc7c263d20dfef4fc4; >= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, < e90ee15ce28c61f6d83a0511c3e02e2662478350; >= fa582c6f3684ac0098a9d02…
Fixed in: Linux 145a56bd68f4bff098d59fbc7c263d20dfef4fc4, Linux 5.16, Linux 5.19

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38520 being exploited?

There is no confirmed exploitation: CVE-2025-38520 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38520?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38520?

Linux \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< c1bde9d48e09933c361521720f77a8072083c83a; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< 145a56bd68f4bff098d59fbc7c263d20dfef4fc4; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< e90ee15ce28c61f6d83a0511c3e02e2662478350; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< a7eb0a25010a674c8fdfbece38353ef7be8c5834; \>= fa582c6f3684ac0098a9d02ddf0ed52a02b37127, \< cf234231fcbc7d391e2135b9518613218cc5347f; 09c5cdbc62d99fc6306a21b24b60eb11a3bd0963; 4b29b8d7c20f54eec0ff266b4a3f419bd251ed83; \>= 5.15.49, \< 5.16; \>= 5.18.6, \< 5.19; Linux 5.19.

### Is there a fix for CVE-2025-38520?

Yes. Fixed in Linux 145a56bd68f4bff098d59fbc7c263d20dfef4fc4, Linux 5.16, Linux 5.19. Upgrade Linux to 5.19 or later.

### How do I check if I'm affected by CVE-2025-38520?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/c1bde9d48e09933c361521720f77a8072083c83a>
- patch: <https://git.kernel.org/stable/c/145a56bd68f4bff098d59fbc7c263d20dfef4fc4>
- patch: <https://git.kernel.org/stable/c/e90ee15ce28c61f6d83a0511c3e02e2662478350>
- patch: <https://git.kernel.org/stable/c/a7eb0a25010a674c8fdfbece38353ef7be8c5834>
- patch: <https://git.kernel.org/stable/c/cf234231fcbc7d391e2135b9518613218cc5347f>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38520>

HTML: <https://flawdb.com/CVE-2025-38520> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38520>
