drm/amdkfd: fix list_del corruption in kfd_criu_resume_svm
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2a909ae718715b3bac75d945e38dc0a5e4a0f1ba · < 8fa5655da368d0306c03e9dc9cda8ae2a7840926| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/amdkfd: fix list_del corruption in kfd_criu_resume_svm
The cleanup tail of kfd_criu_resume_svm() walks svms->criu_svm_metadata_list and kfree()s each struct criu_svm_metadata without removing it from the list. The list head is left pointing at freed kmalloc-96 objects.
A second AMDKFD_IOC_CRIU_OP from the same process re-enters: list_empty() reads the dangling ->next (use-after-free), the loop walks freed entries, and each is kfree()'d again (double-free). This is reachable by an unprivileged render-group user via /dev/kfd with no capabilities required.
Add list_del() before the kfree() so the list is properly emptied. The list_for_each_entry_safe() iterator already caches the next pointer, so unlinking during the walk is safe.
(cherry picked from commit 6322d278a298e2c1430b9d2697743d3a04b788b1)
From the CVE record · Linux
The Linux kernel's AMDKFD CRIU resume cleanup leaves freed entries on a list. A local, unprivileged render-group user with access to /dev/kfd can trigger a use-after-free and double-free by issuing a second AMDKFD_IOC_CRIU_OP from the same process; no capabilities are required.
Administrators running Linux kernels with the affected drm/amdkfd code should check their installations; affected versions were not specified.