{"id":"CVE-2026-90047","summary":"drm/xe: Don't hand out the flat CCS storage as usable VRAM","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/xe: Don't hand out the flat CCS storage as usable VRAM\n\nget_flat_ccs_offset() reads the base of the flat CCS storage from the\nhardware, scales it by the number of enabled L3 nodes, and rounds the\nresult up to 128K.  Everything below that offset is then handed to the\nVRAM allocator as usable memory.\n\nRounding a limit that means \"usable memory ends here\" upwards publishes\nwhatever lies between the real base and the rounded one as free memory,\nand that memory belongs to the compression hardware.  The scaled value\nhas no reason to be 128K aligned, and on a Battlemage G21 with 16 GiB it\nis not:\n\n\tflat CCS base: raw 0x3fafff800, rounded 0x3fb000000\n\nso the last 2 KiB of page 0x3fafff000 is CCS storage, in the allocator's\npool.  Whatever is allocated there gets that tail overwritten by the\ncompression hardware, which needs no page-table entry, no buffer object\nand no GPU submission to do it, and does it before userspace exists.\n\nOn this machine a Mesa VM's level-3 page table landed on that page on\nevery cold boot.  It lost the entry covering the compositor's\nbatch-buffer heap, so the compositor's first submission faulted fetching\nits batch and gdm restarted it forever: a black screen on an otherwise\nworking machine.  Restarting gdm cleared it because the next VM's page\ntables were allocated somewhere else.\n\nRound down instead, to the page size the allocator works in.  On this\nmachine that excludes exactly one page.\n\nReading the reserved page afterwards shows what had been writing it:\n\n\t[369] 0xcccc000000000000\n\t[371] 0xcc77000000000000\n\t[373] 0xcccc000000000000\n\t[375] 0xcc77000000000000\n\ncompression metadata, two bytes per sixteen, sitting where the driver\nused to hand out memory.\n\nThe assertion that should have caught this compares the offset against\nGSMBASE - ccs_size for equality.  That value is 128K aligned, so it\nagrees with the rounded-up offset precisely when the base is not\naligned - the check cannot fail in the case it exists to catch, and is\ncompiled out unless CONFIG_DRM_XE_DEBUG is set.  Replace it with one\nthat can fail: CCS storage must not run into GSM.\n\n[ And this was a debug session from hell, enormously helped by an AI\n  doing much of the grunt-work.\n\n  I'd like to call it my tireless helper, but the AI several times\n  stated flat out that this was impossible and unsolvable and that we\n  should just write a report about it.\n\n  I suspect those things have been trained by people who may not be\n  quite as stubborn as I am.\n\n  But while the AI was ready to give up several times, it did keep\n  adding debug code and analyzing it faithfully when I pushed. So credit\n  where credit is due and I let the AI write the commit message above.\n\n  This is basically a one-liner fixing a bogus \"round_up()\" to a\n  \"round_down()\", but there were 24 patches adding more and more debug\n  information to this, and 18 kernel boot to finally narrow it down to\n  this.   - Linus ]","modified":"2026-09-17T03:47:27.628295102Z","published":"2026-09-16T10:33:43.851Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/90xxx/CVE-2026-90047.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/348c3db4f1520d36764ac8cae2492f50599714f6"},{"type":"WEB","url":"https://git.kernel.org/stable/c/818bebeb63dd6bf5f4e07e145f6cdbace520a34c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c96477e0cabf55bfbdf078078e9de1c8024f8060"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/90xxx/CVE-2026-90047.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-90047"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"37173392741c425191b959acb3adf70c9a4610c0"},{"fixed":"c96477e0cabf55bfbdf078078e9de1c8024f8060"},{"fixed":"348c3db4f1520d36764ac8cae2492f50599714f6"},{"fixed":"818bebeb63dd6bf5f4e07e145f6cdbace520a34c"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-90047.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.51"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.2.5"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-90047.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}