drm/virtio: release the GEM object on virtio_gpu_vram_create() errors
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 16845c5d540929d2f4dc845f11fbbb238e69170a · < 7c8deb77d05bcc8f79e255f669d82ec6ce91be12| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/virtio: release the GEM object on virtio_gpu_vram_create() errors
virtio_gpu_vram_create() frees the object with a bare kfree(vram) on both error paths after drm_gem_private_object_init() has run, and on the second one after drm_gem_create_mmap_offset() has linked obj->vma_node into the device's VMA offset manager. The freed object stays in that interval tree, so a later lookup or insertion walks freed memory, and the dma_resv and gpuva lock are never destroyed.
Call drm_gem_object_release() before kfree() on both paths.
From the CVE record · Linux
Error paths in virtio_gpu_vram_create() free a GEM object without releasing it, potentially leaving a reference to freed memory in the VMA offset manager. A later lookup or insertion can access that freed memory. The input does not specify how an attacker could trigger the error or whether access or user interaction is required.
Engineers running Linux kernels with the drm/virtio driver should check their versions; affected versions were not provided.