drm: Fix drm_crtc_commit leak if signaled when PAGE_FLIP_EVENT is used
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 24835e442f289813aa568d142a755672a740503c · < 66b1b309886337745d395bbc158440ab196305ce| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm: Fix drm_crtc_commit leak if signaled when PAGE_FLIP_EVENT is used
Commit 1c6ceeee6ebb ("drm/atomic: Fix memleak on ERESTARTSYS during non-blocking commits") fixed a very similar issue when the event was allocated by drm_atomic_helper_setup_commit() itself.
However, if the event is allocated in prepare_signaling(), it will also be set to NULL in complete_signaling(), which prevents drm_crtc_commit from being put in __drm_atomic_helper_crtc_destroy_state().
Dropping the reference when the event is set to NULL at complete_signaling() fixes the leak.
The leak can be reproduced by sending a signal to the thread using DRM_MODE_PAGE_FLIP_EVENT and using a sw_sync fence to cause the atomic ioctl to block at drm_atomic_helper_wait_for_fences(). It happened both with amdgpu and vkms.
From the CVE record · Linux
The Linux kernel can leak a drm_crtc_commit reference when a signal interrupts an atomic commit using DRM_MODE_PAGE_FLIP_EVENT. The leak can be reproduced locally by signaling a thread while its atomic ioctl is blocked waiting for a sw_sync fence; the report observed it with amdgpu and vkms. No remote or authentication conditions are described.
Engineers running Linux kernels with DRM atomic commits should check their kernel vendor’s advisory for affected versions.