CVE-2025-21632

In the Linux kernel, the following vulnerability has been resolved: x86/fpu: Ensure shadow stack is active before "getting" registers The x86 shadow stack support has its own set of registers. Those registers are XSAVE-managed, but they are "supervisor state components" which means that userspace can not touch them with XSAVE/XRSTOR. It also means that they are not accessible from the existing ptrace ABI for XSAVE state. Thus, there is a new ptrace get/set interface for it. The regset code that ptrace uses provides an ->active() handler in addition to the get/set ones. For shadow stack this ->active() handler verifies that shadow stack is enabled via the ARCH_SHSTK_SHSTK bit in the thread struct. The ->active() handler is checked from some call sites of the regset get/set handlers, but not the ptrace ones. This was not understood when shadow stack support was put in place. As a result, both the set/get handlers can be called with XFEATURE_CET_USER in its init state, which would cause get_xsave_addr() to return NULL and trigger a WARN_ON(). The ssp_set() handler luckily has an ssp_active() check to avoid surprising the kernel with shadow stack behavior when the kernel is not ready for it (ARCH_SHSTK_SHSTK==0). That check just happened to avoid the warning. But the ->get() side wasn't so lucky. It can be called with shadow stacks disabled, triggering the warning in practice, as reported by Christina Schimpe: WARNING: CPU: 5 PID: 1773 at arch/x86/kernel/fpu/regset.c:198 ssp_get+0x89/0xa0 [...] Call Trace: <TASK> ? show_regs+0x6e/0x80 ? ssp_get+0x89/0xa0 ? __warn+0x91/0x150 ? ssp_get+0x89/0xa0 ? report_bug+0x19d/0x1b0 ? handle_bug+0x46/0x80 ? exc_invalid_op+0x1d/0x80 ? asm_exc_invalid_op+0x1f/0x30 ? __pfx_ssp_get+0x10/0x10 ? ssp_get+0x89/0xa0 ? ssp_get+0x52/0xa0 __regset_get+0xad/0xf0 copy_regset_to_user+0x52/0xc0 ptrace_regset+0x119/0x140 ptrace_request+0x13c/0x850 ? wait_task_inactive+0x142/0x1d0 ? do_syscall_64+0x6d/0x90 arch_ptrace+0x102/0x300 [...] Ensure that shadow stacks are active in a thread before looking them up in the XSAVE buffer. Since ARCH_SHSTK_SHSTK and user_ssp[SHSTK_EN] are set at the same time, the active check ensures that there will be something to find in the XSAVE buffer. [ dhansen: changelog/subject tweaks ]
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:*

History

24 Sep 2025, 16:36

Type Values Removed Values Added
First Time Linux linux Kernel
Linux
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CWE CWE-476
CPE cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*
References () https://git.kernel.org/stable/c/0a3a872214188e4268d31581ed0cd44508e038cf - () https://git.kernel.org/stable/c/0a3a872214188e4268d31581ed0cd44508e038cf - Patch
References () https://git.kernel.org/stable/c/6bfe1fc22f462bec87422cdcbec4d7a2f43ff01d - () https://git.kernel.org/stable/c/6bfe1fc22f462bec87422cdcbec4d7a2f43ff01d - Patch
References () https://git.kernel.org/stable/c/a9d9c33132d49329ada647e4514d210d15e31d81 - () https://git.kernel.org/stable/c/a9d9c33132d49329ada647e4514d210d15e31d81 - Patch
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: x86/fpu: Asegúrese de que la pila de sombras esté activa antes de "obtener" registros El soporte de la pila de sombras x86 tiene su propio conjunto de registros. Esos registros son administrados por XSAVE, pero son "componentes de estado de supervisor", lo que significa que el espacio de usuario no puede tocarlos con XSAVE/XRSTOR. También significa que no son accesibles desde la ABI de ptrace existente para el estado XSAVE. Por lo tanto, hay una nueva interfaz get/set de ptrace para ello. El código de conjunto de registros que usa ptrace proporciona un controlador -&gt;active() además de los de obtención/configuración. Para la pila de sombras, este controlador -&gt;active() verifica que la pila de sombras esté habilitada a través del bit ARCH_SHSTK_SHSTK en la estructura del hilo. El controlador -&gt;active() se verifica desde algunos sitios de llamada de los controladores get/set de conjuntos de registros, pero no de los de ptrace. Esto no se comprendió cuando se implementó el soporte de la pila de sombras. Como resultado, ambos manejadores set/get pueden ser llamados con XFEATURE_CET_USER en su estado init, lo que haría que get_xsave_addr() devuelva NULL y active un WARN_ON(). El manejador ssp_set() afortunadamente tiene una verificación ssp_active() para evitar sorprender al kernel con el comportamiento de la pila shadow cuando el kernel no está listo para ello (ARCH_SHSTK_SHSTK==0). Esa verificación simplemente sucedió para evitar la advertencia. Pero el lado -&gt;get() no tuvo tanta suerte. Puede ser llamado con las pilas shadow deshabilitadas, lo que activa la advertencia en la práctica, como lo informó Christina Schimpe: ADVERTENCIA: CPU: 5 PID: 1773 en arch/x86/kernel/fpu/regset.c:198 ssp_get+0x89/0xa0 [...] Seguimiento de llamadas: ? show_regs+0x6e/0x80 ? ssp_get+0x89/0xa0 ? __warn+0x91/0x150 ? ssp_get+0x89/0xa0 ? report_bug+0x19d/0x1b0 ? handle_bug+0x46/0x80 ? exc_invalid_op+0x1d/0x80 ? asm_exc_invalid_op+0x1f/0x30 ? __pfx_ssp_get+0x10/0x10 ? ssp_get+0x89/0xa0 ? ssp_get+0x52/0xa0 __regset_get+0xad/0xf0 copy_regset_to_user+0x52/0xc0 ptrace_regset+0x119/0x140 ptrace_request+0x13c/0x850 ? wait_task_inactive+0x142/0x1d0 ? do_syscall_64+0x6d/0x90 arch_ptrace+0x102/0x300 [...] Asegúrese de que las pilas de sombras estén activas en un hilo antes de buscarlas en el búfer XSAVE. Dado que ARCH_SHSTK_SHSTK y user_ssp[SHSTK_EN] se configuran al mismo tiempo, la comprobación activa garantiza que habrá algo que encontrar en el búfer XSAVE. [ dhansen: registro de cambios/asunto ajustes ]

19 Jan 2025, 11:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-01-19 11:15

Updated : 2025-09-24 16:36


NVD link : CVE-2025-21632

Mitre link : CVE-2025-21632

CVE.ORG link : CVE-2025-21632


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-476

NULL Pointer Dereference