Bug 2300487 (CVE-2024-41092) - CVE-2024-41092 kernel: drm/i915/gt: Fix potential UAF by revoke of fence registers
Summary: CVE-2024-41092 kernel: drm/i915/gt: Fix potential UAF by revoke of fence regi...
Keywords:
Status: NEW
Alias: CVE-2024-41092
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2301679
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-07-29 16:22 UTC by OSIDB Bzimport
Modified: 2024-11-18 01:20 UTC (History)
7 users (show)

Fixed In Version: kernel 5.10.221, kernel 5.15.162, kernel 6.1.97, kernel 6.6.37, kernel 6.9.8, kernel 6.10
Doc Type: If docs needed, set a value
Doc Text:
A possible use-after-free was found in the Linux kernel in drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2024:9635 0 None None None 2024-11-14 10:00:05 UTC
Red Hat Product Errata RHBA-2024:9811 0 None None None 2024-11-18 01:20:36 UTC
Red Hat Product Errata RHSA-2024:8856 0 None None None 2024-11-05 01:10:16 UTC
Red Hat Product Errata RHSA-2024:8870 0 None None None 2024-11-05 00:50:02 UTC
Red Hat Product Errata RHSA-2024:9315 0 None None None 2024-11-12 09:37:22 UTC

Description OSIDB Bzimport 2024-07-29 16:22:05 UTC
In the Linux kernel, the following vulnerability has been resolved:

drm/i915/gt: Fix potential UAF by revoke of fence registers

CI has been sporadically reporting the following issue triggered by
igt@i915_selftest@live@hangcheck on ADL-P and similar machines:

<6> [414.049203] i915: Running intel_hangcheck_live_selftests/igt_reset_evict_fence
...
<6> [414.068804] i915 0000:00:02.0: [drm] GT0: GUC: submission enabled
<6> [414.068812] i915 0000:00:02.0: [drm] GT0: GUC: SLPC enabled
<3> [414.070354] Unable to pin Y-tiled fence; err:-4
<3> [414.071282] i915_vma_revoke_fence:301 GEM_BUG_ON(!i915_active_is_idle(&fence->active))
...
<4>[  609.603992] ------------[ cut here ]------------
<2>[  609.603995] kernel BUG at drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c:301!
<4>[  609.604003] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
<4>[  609.604006] CPU: 0 PID: 268 Comm: kworker/u64:3 Tainted: G     U  W          6.9.0-CI_DRM_14785-g1ba62f8cea9c+ #1
<4>[  609.604008] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR4 RVP, BIOS RPLPFWI1.R00.4035.A00.2301200723 01/20/2023
<4>[  609.604010] Workqueue: i915 __i915_gem_free_work [i915]
<4>[  609.604149] RIP: 0010:i915_vma_revoke_fence+0x187/0x1f0 [i915]
...
<4>[  609.604271] Call Trace:
<4>[  609.604273]  <TASK>
...
<4>[  609.604716]  __i915_vma_evict+0x2e9/0x550 [i915]
<4>[  609.604852]  __i915_vma_unbind+0x7c/0x160 [i915]
<4>[  609.604977]  force_unbind+0x24/0xa0 [i915]
<4>[  609.605098]  i915_vma_destroy+0x2f/0xa0 [i915]
<4>[  609.605210]  __i915_gem_object_pages_fini+0x51/0x2f0 [i915]
<4>[  609.605330]  __i915_gem_free_objects.isra.0+0x6a/0xc0 [i915]
<4>[  609.605440]  process_scheduled_works+0x351/0x690
...

In the past, there were similar failures reported by CI from other IGT
tests, observed on other platforms.

Before commit 63baf4f3d587 ("drm/i915/gt: Only wait for GPU activity
before unbinding a GGTT fence"), i915_vma_revoke_fence() was waiting for
idleness of vma->active via fence_update().   That commit introduced
vma->fence->active in order for the fence_update() to be able to wait
selectively on that one instead of vma->active since only idleness of
fence registers was needed.  But then, another commit 0d86ee35097a
("drm/i915/gt: Make fence revocation unequivocal") replaced the call to
fence_update() in i915_vma_revoke_fence() with only fence_write(), and
also added that GEM_BUG_ON(!i915_active_is_idle(&fence->active)) in front.
No justification was provided on why we might then expect idleness of
vma->fence->active without first waiting on it.

The issue can be potentially caused by a race among revocation of fence
registers on one side and sequential execution of signal callbacks invoked
on completion of a request that was using them on the other, still
processed in parallel to revocation of those fence registers.  Fix it by
waiting for idleness of vma->fence->active in i915_vma_revoke_fence().

(cherry picked from commit 24bb052d3dd499c5956abad5f7d8e4fd07da7fb1)

Comment 1 Mauro Matteo Cascella 2024-07-30 15:31:47 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024072953-CVE-2024-41092-8bd7@gregkh/T

Comment 2 Mauro Matteo Cascella 2024-07-30 15:32:08 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2301679]

Comment 11 errata-xmlrpc 2024-11-05 00:50:01 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:8870 https://access.redhat.com/errata/RHSA-2024:8870

Comment 12 errata-xmlrpc 2024-11-05 01:10:15 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:8856 https://access.redhat.com/errata/RHSA-2024:8856

Comment 13 errata-xmlrpc 2024-11-12 09:37:21 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:9315 https://access.redhat.com/errata/RHSA-2024:9315


Note You need to log in before you can comment on or make changes to this bug.