CVE-2026-23225
JSON

7.8high

sched/mmcid: Don't assume CID is CPU owned on mode switch

Severity
7.8high CVSS:3.1 by Linux
Exploit likelihood
0.13% (higher than 3% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: sched/mmcid: Don't assume CID is CPU owned on mode switch Shinichiro reported a KASAN UAF, which is actually an out of bounds access in the MMCID management code. CPU0 CPU1 T1 runs in userspace T0: fork(T4) -> Switch to per CPU CID mode fixup() set MM_CID_TRANSIT on T1/CPU1 T4 exit() T3 exit() T2 exit() T1 exit() switch to per task mode ---> Out of bounds access. As T1 has not scheduled after T0 set the TRANSIT bit, it exits with the TRANSIT bit set. sched_mm_cid_remove_user() clears the TRANSIT bit in the task and drops the CID, but it does not touch the per CPU storage. That's functionally correct because a CID is only owned by the CPU when the ONCPU bit is set, which is mutually exclusive with the TRANSIT flag. Now sched_mm_cid_exit() assumes that the CID is CPU owned because the prior mode was per CPU. It invokes mm_drop_cid_on_cpu() which clears the not set ONCPU bit and then invokes clear_bit() with an insanely large bit number because TRANSIT is set (bit 29). Prevent that by actually validating that the CID is CPU owned in mm_drop_cid_on_cpu().

Affected

Product or packageVersionsReported by
Linux Linuxfrom 007d84287c7466ca68a5809b616338214dc5b77b before 81f29975631db8a78651b3140ecd0f88ffafc476, from 007d84287c7466ca68a5809b616338214dc5b77b before 1e83ccd5921a610ef409a7d4e56db27822b4ea39, 6.19
Not affected: before 6.19, from 6.19.1 up to 6.19.*, from 7.0 up to *
CVE List

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: sched/mmcid: Don't assume CID is CPU owned on mode switch Shinichiro reported a KASAN UAF, which is actually an out of bounds access in the MMCID management code. CPU0 CPU1 T1 runs in userspace T0: fork(T4) -> Switch to per CPU CID mode fixup() set MM_CID_TRANSIT on T1/CPU1 T4 exit() T3 exit() T2 exit() T1 exit() switch to per task mode ---> Out of bounds access. As T1 has not scheduled after T0 set the TRANSIT bit, it exits with the TRANSIT bit set. sched_mm_cid_remove_user() clears the TRANSIT bit in the task and drops the CID, but it does not touch the per CPU storage. That's functionally correct because a CID is only owned by the CPU when the ONCPU bit is set, which is mutually exclusive with the TRANSIT flag. Now sched_mm_cid_exit() assumes that the CID is CPU owned because the prior mode was per CPU. It invokes mm_drop_cid_on_cpu() which clears the not set ONCPU bit and then invokes clear_bit() with an insanely large bit number because TRANSIT is set (bit 29). Prevent that by actually validating that the CID is CPU owned in mm_drop_cid_on_cpu().

NVD (es)

Se ha resuelto la siguiente vulnerabilidad en el kernel de Linux: sched/mmcid: No asumir que el CID es propiedad de la CPU en el cambio de modo Shinichiro informó de un KASAN UAF, que en realidad es un acceso fuera de límites en el código de gestión de MMCID. CPU0 CPU1 T1 se ejecuta en espacio de usuario T0: fork(T4) -> Cambio a modo CID por CPU fixup() establece MM_CID_TRANSIT en T1/CPU1 T4 sale() T3 sale() T2 sale() T1 sale() cambia a modo por tarea ---> Acceso fuera de límites. Como T1 no se ha planificado después de que T0 estableciera el bit TRANSIT, sale con el bit TRANSIT establecido. sched_mm_cid_remove_user() borra el bit TRANSIT en la tarea y elimina el CID, pero no toca el almacenamiento por CPU. Eso es el funcionalmente correcto porque un CID solo es propiedad de la CPU cuando el bit ONCPU está establecido, lo cual es mutuamente excluyente con el indicador TRANSIT. Ahora sched_mm_cid_exit() asume que el CID es propiedad de la CPU porque el modo anterior era por CPU. Invoca mm_drop_cid_on_cpu() que borra el bit ONCPU no establecido y luego invoca clear_bit() con un número de bit increíblemente grande porque TRANSIT está establecido (bit 29). Evitar eso validando realmente que el CID es propiedad de la CPU en mm_drop_cid_on_cpu().

References

Sources

SourceRecordLicence
CVE ListCVE-2026-23225 changed 2026-08-05CVE Terms of Use
NVDCVE-2026-23225 changed 2026-06-17Public domain