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 intelhangcheckliveselftests/igtresetevictfence ... <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] i915vmarevokefence:301 GEMBUGON(!i915activeisidle(&fence->active)) ... <4>[ 609.603992] ------------[ cut here ]------------ <2>[ 609.603995] kernel BUG at drivers/gpu/drm/i915/gt/intelggttfencing.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-CIDRM14785-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 _i915gemfreework [i915] <4>[ 609.604149] RIP: 0010:i915vmarevokefence+0x187/0x1f0 [i915] ... <4>[ 609.604271] Call Trace: <4>[ 609.604273] <TASK> ... <4>[ 609.604716] _i915vmaevict+0x2e9/0x550 [i915] <4>[ 609.604852] _i915vmaunbind+0x7c/0x160 [i915] <4>[ 609.604977] forceunbind+0x24/0xa0 [i915] <4>[ 609.605098] i915vmadestroy+0x2f/0xa0 [i915] <4>[ 609.605210] _i915gemobjectpagesfini+0x51/0x2f0 [i915] <4>[ 609.605330] _i915gemfreeobjects.isra.0+0x6a/0xc0 [i915] <4>[ 609.605440] processscheduled_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"), i915vmarevokefence() was waiting for idleness of vma->active via fenceupdate(). That commit introduced vma->fence->active in order for the fenceupdate() 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 fenceupdate() in i915vmarevokefence() with only fencewrite(), and also added that GEMBUGON(!i915activeis_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 i915vmarevoke_fence().
(cherry picked from commit 24bb052d3dd499c5956abad5f7d8e4fd07da7fb1)
{ "vanir_signatures": [ { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "167560388747391913782198875333442545639", "102079970968903703273084850083354862194", "108612656548990223270827533329410511909", "153904240657900805934076382849828477600" ], "threshold": 0.9 }, "id": "CVE-2024-41092-0c28cb0c", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ca0fabd365a27a94a36e68a7a02df8ff3c13dac6" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "167560388747391913782198875333442545639", "102079970968903703273084850083354862194", "108612656548990223270827533329410511909", "153904240657900805934076382849828477600" ], "threshold": 0.9 }, "id": "CVE-2024-41092-0df8bfbe", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@996c3412a06578e9d779a16b9e79ace18125ab50" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c", "function": "i915_vma_revoke_fence" }, "signature_version": "v1", "digest": { "length": 436.0, "function_hash": "318146450634443180529416364688488640587" }, "id": "CVE-2024-41092-14d2eae5", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@996c3412a06578e9d779a16b9e79ace18125ab50" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c", "function": "i915_vma_revoke_fence" }, "signature_version": "v1", "digest": { "length": 436.0, "function_hash": "318146450634443180529416364688488640587" }, "id": "CVE-2024-41092-4135ee75", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@29c0fdf49078ab161570d3d1c6e13d66f182717d" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c", "function": "i915_vma_revoke_fence" }, "signature_version": "v1", "digest": { "length": 436.0, "function_hash": "318146450634443180529416364688488640587" }, "id": "CVE-2024-41092-426c5543", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@414f4a31f7a811008fd9a33b06216b060bad18fc" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "167560388747391913782198875333442545639", "102079970968903703273084850083354862194", "108612656548990223270827533329410511909", "153904240657900805934076382849828477600" ], "threshold": 0.9 }, "id": "CVE-2024-41092-4b579e7e", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f771b91f21c46ad1217328d05e72a2c7e3add535" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c", "function": "i915_vma_revoke_fence" }, "signature_version": "v1", "digest": { "length": 436.0, "function_hash": "318146450634443180529416364688488640587" }, "id": "CVE-2024-41092-72d50c85", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@06dec31a0a5112a91f49085e8a8fa1a82296d5c7" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c", "function": "i915_vma_revoke_fence" }, "signature_version": "v1", "digest": { "length": 436.0, "function_hash": "318146450634443180529416364688488640587" }, "id": "CVE-2024-41092-9159d4f6", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ca0fabd365a27a94a36e68a7a02df8ff3c13dac6" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "167560388747391913782198875333442545639", "102079970968903703273084850083354862194", "108612656548990223270827533329410511909", "153904240657900805934076382849828477600" ], "threshold": 0.9 }, "id": "CVE-2024-41092-9ca5778e", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@06dec31a0a5112a91f49085e8a8fa1a82296d5c7" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "167560388747391913782198875333442545639", "102079970968903703273084850083354862194", "108612656548990223270827533329410511909", "153904240657900805934076382849828477600" ], "threshold": 0.9 }, "id": "CVE-2024-41092-a8a312f8", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@414f4a31f7a811008fd9a33b06216b060bad18fc" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "167560388747391913782198875333442545639", "102079970968903703273084850083354862194", "108612656548990223270827533329410511909", "153904240657900805934076382849828477600" ], "threshold": 0.9 }, "id": "CVE-2024-41092-da03f549", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@29c0fdf49078ab161570d3d1c6e13d66f182717d" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c", "function": "i915_vma_revoke_fence" }, "signature_version": "v1", "digest": { "length": 436.0, "function_hash": "318146450634443180529416364688488640587" }, "id": "CVE-2024-41092-e3478614", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f771b91f21c46ad1217328d05e72a2c7e3add535" } ] }