CVE-2026-99186: x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx()
Commit 45e1dccc0653 ("x86/insn: Simplify for_each_insn_prefix()") made for_each_insn_prefix() declare its own loop counter named idx. get_seg_reg_override_idx() keeps its result in a local of the same name, so the assignments in the loop body now write the loop counter:
- the function always returns INAT_SEG_REG_DEFAULT, so FS and GS overrides are ignored;
- a CS override sets the counter to INAT_SEG_REG_CS (2), the increment makes it 3, and prefixes.bytes[3] holds the last prefix, 0x2e again, so the loop never terminates.
The UMIP emulation reaches this from the #GP handler for user space: an SGDT, SIDT or SMSW with a memory operand and a CS prefix leaves the task spinning in the kernel, never returning to user space, with a SIGKILL that is never delivered. Any user can thus tie up CPUs until reboot. With an FS or GS prefix, the emulated result is written to the wrong address.
Rename the internal macro iterator variable.
[ Lukas' original patch renamed the use site, I changed it to rename the
iterator in the macro instead, but left Lukas' commit message and
authorship - Linus ]
The Linux kernel CVE team has assigned CVE-2026-99186 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.19 with commit 45e1dccc0653c50e377dae57ef086a8d0f71061d and fixed in 7.2.13 with commit 0efe927053f7eabd1e8658cbda96ee3d78bd1765 Issue introduced in 6.19 with commit 45e1dccc0653c50e377dae57ef086a8d0f71061d and fixed in 7.3 with commit 32c52ec87d6245ee2d12ed5dd509e40062939b50
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-99186
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:
arch/x86/include/asm/insn.h tools/arch/x86/include/asm/insn.h
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/0efe927053f7eabd1e8658cbda96ee3d78bd1765 https://git.kernel.org/stable/c/32c52ec87d6245ee2d12ed5dd509e40062939b50