drm/vmwgfx: Fix a deadlock in dma buf fence polling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2298e804e96eb3635c39519c8287befd92460303 · < e58337100721f3cc0c7424a18730e4f39844934f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/vmwgfx: Fix a deadlock in dma buf fence polling
Introduce a version of the fence ops that on release doesn't remove the fence from the pending list, and thus doesn't require a lock to fix poll->fence wait->fence unref deadlocks.
vmwgfx overwrites the wait callback to iterate over the list of all fences and update their status, to do that it holds a lock to prevent the list modifcations from other threads. The fence destroy callback both deletes the fence and removes it from the list of pending fences, for which it holds a lock.
dma buf polling cb unrefs a fence after it's been signaled: so the poll calls the wait, which signals the fences, which are being destroyed. The destruction tries to acquire the lock on the pending fences list which it can never get because it's held by the wait from which it was called.
Old bug, but not a lot of userspace apps were using dma-buf polling interfaces. Fix those, in particular this fixes KDE stalls/deadlock.
From the CVE record · Linux
The Linux kernel’s vmwgfx driver can deadlock while polling dma-buf fences because a fence callback tries to acquire a lock already held by the wait callback. A userspace application using dma-buf polling can trigger stalls, including KDE stalls; the input does not establish authentication requirements or a remote attack path.
Check Linux kernel deployments using vmwgfx, especially those with userspace applications that poll dma-buf fences; affected versions are not specified.