drm/amdkfd: Fix the case that vm range is hole at svm_migrate_copy_to_vram
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 50ea50cf6f6d31d3235ad1853c5dbea766a3ed11 · < 520e345ffe05aabef1db82beda4288afb1757ff2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/amdkfd: Fix the case that vm range is hole at svm_migrate_copy_to_vram
When migration vm range is hole at cpu side(MIGRATE_PFN_MIGRATE set + MIGRATE_PFN_VALID unset) driver still allocates device pages. There is no dma map of src pages and migration. j is 0 and svm_migrate_copy_memory_gart() will return an uninitialized r. That can trigger out_free_vram_pages to drop all VRAM just set up.
Initialize r and only call the last svm_migrate_copy_memory_gart if j > 0.
Current code postponed the last page to the final copy. This patch flushes on the last page when reach to the end of current drm_buddy_block; avoids another svm_migrate_copy_memory_gart.
From the CVE record · Linux
During SVM migration, a hole in the CPU-side VM range can leave a return value uninitialized and cause newly set-up VRAM pages to be dropped. An attacker who can trigger this condition may cause that page loss. The input does not specify whether network or local access, authentication, or user interaction is required.
Engineers running the Linux kernel should check whether their version includes the drm/amdkfd fix; affected versions are not specified.