drm/amdkfd: split vram_pages of SVM ranges prefetched without a GPU mapping

State
Published
Severity
Not Scored
Published
Nov 30, 2026
Updated
Nov 30, 2026
Reserved
Sep 25, 2026

Read the record on cve.org

Description

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

drm/amdkfd: split vram_pages of SVM ranges prefetched without a GPU mapping

When an SVM range is split, svm_range_split_pages() gives the new range the number of VRAM pages counted in its part of the dma_addr arrays and subtracts it from the old range. Pages migrated to VRAM by a prefetch have no dma_addr entries until the range is mapped on a GPU, e.g. with no ACCESS attribute, or with XNACK off before the delayed restore worker mapped it, so the new range gets 0 and the old one keeps the count for both.

Migrating the parts back to system memory then gets the accounting wrong: the old part keeps a VRAM page count after all its pages are gone, so its svm_bo is never freed, and the new part underflows. On navi31, as an unprivileged process: prefetch 4 MiB to the GPU, prefetch the upper 2 MiB and then the lower 2 MiB back to system memory:

Recorded vram pages(0x0) should not be less than migration pages(0x200). WARNING: ../amdkfd/kfd_migrate.c:922 at svm_migrate_vram_to_ram+0xbdc/0xcd0 [amdgpu]

and /sys/class/kfd/kfd/proc/<pid>/vram_<gpu_id> stays at 4194304 until the process exits.

Without dma_addr arrays, the split is still exact when the old range is completely in VRAM, which is what a prefetch of the whole range leaves. Give the new range all its pages in that case. The warning is gone and the VRAM usage drops back to 0.

This doesn't cover a range that is only partly in VRAM without dma_addr arrays, e.g. after a partial migration, since svm_migrate_ram_to_vram() only counts the pages it actually migrated. That would need VRAM residency to be tracked per page independently of dma_addr.

v2: - Rename counted to has_dma_addr and compare against old->npages (Philip) - Mention the XNACK off case and the partial migration limitation (Philip)

(cherry picked from commit 7ca6f3359b557a267c7b07a2fd748b1473395e10)

ProductVersions
Linux Linux006ad514a50cc49d904fd004b69c842ddfaabf1f to before 179bf8516d1276eda573245bbca6dc95f370aacb Affected006ad514a50cc49d904fd004b69c842ddfaabf1f to before 08a3f27f91a91fe105012ce8d910540d6a54b37d Affected006ad514a50cc49d904fd004b69c842ddfaabf1f to before 72360c3c34ef95f4ca0b27574c765d67504516c2 Affected006ad514a50cc49d904fd004b69c842ddfaabf1f to before 52957e813f2f025c86e4aa6e86cb4963ef94fd00 Affected
Linux Linux6.8 Affectedbefore 6.8 Not Affected6.12.117 through 6.12.* Not Affected6.18.63 through 6.18.* Not Affected7.3.4 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.