Linux
drm/amdkfd: Fix the case that vm range is hole at svm_migrate_copy_to_vram
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 50ea50cf6f6d31d3235ad1853c5dbea766a3ed11, < d5872c81c70163a3ba9eb4da9a94c92b03067576
- >= 50ea50cf6f6d31d3235ad1853c5dbea766a3ed11, < 6e1a6f3ddb87d7f89a775c55fb399680c02bdcc2
- >= 50ea50cf6f6d31d3235ad1853c5dbea766a3ed11, < bd1adb2e5101db649121b59e601c92773a302a70
- >= 50ea50cf6f6d31d3235ad1853c5dbea766a3ed11, < ae806a95b28fcecb913430cfa45a252e91a945d6
- >= 50ea50cf6f6d31d3235ad1853c5dbea766a3ed11, < 0a9a0e8a97da70a0336c9115178aaf1be29bcfb1
- >= 50ea50cf6f6d31d3235ad1853c5dbea766a3ed11, < 520e345ffe05aabef1db82beda4288afb1757ff2
Fixed in d5872c81c70163a3ba9eb4da9a94c92b03067576, 6e1a6f3ddb87d7f89a775c55fb399680c02bdcc2, bd1adb2e5101db649121b59e601c92773a302a70, ae806a95b28fcecb913430cfa45a252e91a945d6, 0a9a0e8a97da70a0336c9115178aaf1be29bcfb1, 520e345ffe05aabef1db82beda4288afb1757ff2
- 5.14
Fixed in 0, 6.1.191, 6.6.160, 6.12.114, 6.18.51, 7.2.5, 7.3
Mitigation
Upgrade Linux to d5872c81c70163a3ba9eb4da9a94c92b03067576 or 6e1a6f3ddb87d7f89a775c55fb399680c02bdcc2 or bd1adb2e5101db649121b59e601c92773a302a70 or ae806a95b28fcecb913430cfa45a252e91a945d6 or 0a9a0e8a97da70a0336c9115178aaf1be29bcfb1 or 520e345ffe05aabef1db82beda4288afb1757ff2 or later.
Upgrade Linux to 0 or 6.1.191 or 6.6.160 or 6.12.114 or 6.18.51 or 7.2.5 or 7.3 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.