CVE-2022-49963: drm/i915/ttm: fix CCS handling
In the Linux kernel, the following vulnerability has been resolved:
drm/i915/ttm: fix CCS handling
Crucible + recent Mesa seems to sometimes hit:
GEMBUGON(numccsblks > NUMCCSBLKSPERXFER)
And it looks like we can also trigger this with gemlmemswapping, if we modify the test to use slightly larger object sizes.
Looking closer it looks like we have the following issues in migratecopy():
- We are using plain integer in various places, which we can easily overflow with a large object.
- We pass the entire object size (when the src is lmem) into emitpte() and then try to copy it, which doesn't work, since we only have a few fixed sized windows in which to map the pages and perform the copy. With an object > 8M we therefore aren't properly copying the pages. And then with an object > 64M we trigger the GEMBUGON(numccsblks > NUMCCSBLKSPERXFER).
So it looks like our copy handling for any object > 8M (which is our CHUNKSZ) is currently broken on DG2.
Testcase: igt@gemlmemswapping (cherry picked from commit 8676145eb2f53a9940ff70910caf0125bd8a4bc2)
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.0.2-1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 8676145eb2f53a9940ff70910caf0125bd8a4bc2
Event History
Frequently Asked Questions
Which systems are affected by this issue?
The issue affects Intel DG2 systems using the Linux kernel i915 TTM path. The described broken copy handling applies to objects larger than 8 MB, with a GEM_BUG_ON condition reachable for objects larger than 64 MB.
What access does an attacker need to exploit it?
The CVSS vector indicates local access and low privileges are required. No user interaction is required.
What is the potential impact?
The CVSS rating is 7.8 High, with high impact to confidentiality, integrity, and availability. The described failure includes an assertion condition during CCS handling and incorrect copying of pages for large objects.
How can I determine whether my environment is exposed?
Check whether the system uses an Intel DG2 GPU with the Linux kernel i915 TTM code path and handles graphics objects larger than 8 MB. Failures may appear as GEM_BUG_ON(num_ccs_blks > NUM_CCS_BLKS_PER_XFER), particularly with objects over 64 MB or during gem_lmem_swapping testing.