drm/i915: fix incorrect RCU teardown order
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 912ff2ebd695c582ca4cebf833ad73a378a99f23 · < d2da6696e0c4e60414706e607029d0bb0330c67e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/i915: fix incorrect RCU teardown order
i915_gem_busy_ioctl uses dma_resv_for_each_fence_unlocked() to iterate over the fences in an GEM object without holding a reference but only the RCU read side lock.
What can happen here is that the GEM object is destroyed concurrently while i915_gem_busy_ioctl is still running. This won't free the GEM objects memory, but still drops all the dma_fence references.
Now when dma_resv_for_each_fence_unlocked() sees a destroyed dma_fence it assumes that a new fence list was installed and re-starts the loop.
But in the case of a destroyed GEM object a new fence list is never installed, only the old one freed and therefore the iteration never finishes resulting in an endless loop.
The solution is to drop the fence references only after the RCU grace period.
The fixes tag is not necessary the patch introducing the problem, but the one making it so worse that we need to address it.
From the CVE record · Linux
The Linux kernel’s i915 GEM busy ioctl can enter an endless loop if a GEM object is destroyed while the ioctl iterates over its fences. This requires a concurrent teardown during the ioctl; the input does not specify authentication requirements.
Engineers running Linux kernels with the i915 driver should check whether their kernel includes the fix; affected versions are not specified.