CVE-2026-31781: drm/ioc32: stop speculation on the drm_compat_ioctl path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
drm/ioc32: stop speculation on the drm_compat_ioctl path
The drm compat ioctl path takes a user controlled pointer, and then dereferences it into a table of function pointers, the signature method of spectre problems. Fix this up by calling array_index_nospec() on the index to the function pointer list.
The Linux kernel CVE team has assigned CVE-2026-31781 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 5.10.253 with commit 46a60ee8956ef1975f00455f614761c7ecedc09d Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 5.15.203 with commit 5bb398991f378ef74d90b14a6ea8b61ff96cc03a Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 6.1.168 with commit d59c5d8539662d95887b4564f3f72ad38076a2d5 Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 6.6.134 with commit 489f2ef2b908898d01df697dc4fe1476674be640 Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 6.12.81 with commit 4a41c2b18fc05d30b718d2602cac339eae710b34 Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 6.18.22 with commit f0e441be08a2eab10b2d06fccfa267ee599dd6b3 Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 6.19.12 with commit 27ef84bba9b9d7b03418c60fbc6069ea0e87b13c Issue introduced in 4.20 with commit 505b5240329b922f21f91d5b5d1e535c805eca6d and fixed in 7.0 with commit f8995c2df519f382525ca4bc90553ad2ec611067 Issue introduced in 3.16.63 with commit abc60edcfc87771ff244763d4d19c67766f5dd0f Issue introduced in 4.4.170 with commit a2a840d6dcae960c2dfdf3fcb1b759e1b7d90663 Issue introduced in 4.9.148 with commit 00279b505289f7529d9be2e78915d0483ffbd314 Issue introduced in 4.14.91 with commit d04e6ea0cec9e7d6cba806508f657d2d0dc6cacf Issue introduced in 4.19.13 with commit 7f3ebea19795eb38438cd3709fabf2afd53cf447
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-31781
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/gpu/drm/drm_ioc32.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/46a60ee8956ef1975f00455f614761c7ecedc09d https://git.kernel.org/stable/c/5bb398991f378ef74d90b14a6ea8b61ff96cc03a https://git.kernel.org/stable/c/d59c5d8539662d95887b4564f3f72ad38076a2d5 https://git.kernel.org/stable/c/489f2ef2b908898d01df697dc4fe1476674be640 https://git.kernel.org/stable/c/4a41c2b18fc05d30b718d2602cac339eae710b34 https://git.kernel.org/stable/c/f0e441be08a2eab10b2d06fccfa267ee599dd6b3 https://git.kernel.org/stable/c/27ef84bba9b9d7b03418c60fbc6069ea0e87b13c https://git.kernel.org/stable/c/f8995c2df519f382525ca4bc90553ad2ec611067