Descripción
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: KVM: arm64: Handle negative S1 walk levels in VNCR TLB size evaluation Calcular los efectos de una invalidación de TLB implica examinar el tamaño de la asignación almacenada en caché por la TLB. Para asignaciones S1 como VNCR, este se deduce de la combinación del tamaño de gránulo base y el nivel de la asignación. Sin embargo, esto supone que la MMU S1 está *activada*. Cuando la MMU está desactivada, se indica estableciendo el nivel en un valor "creativo" de -127 (S1_MMU_DISABLED). Esto termina siendo malinterpretado por pgshift_level_to_ttl(), ya que no maneja niveles negativos en absoluto (el nivel se convierte inmediatamente a u8 y solo se consideran los dos bits inferiores), lo que produce un tamaño de invalidación de 0. Nada útil. Se ordena pgshift_level_to_ttl() para que maneje estos niveles negativos, y ttl_to_size() para que siempre devuelva SZ_1G cuando no exista un TTL válido. Esto permite eliminar verificaciones codificadas manualmente para situaciones similares. Cabe señalar que la verificación de un valor negativo sin comprobar explícitamente S1_MMU_DISABLED es deliberada, para que los niveles negativos reales introducidos con LVA2 y D128 puedan seguir la misma ruta si alguna vez se admiten.
Qué hacer
Revisa si usas el producto afectado y en qué versión, y aplica la actualización o la mitigación que indique el aviso del fabricante. CISA no ha confirmado que se esté explotando; si eso cambia, esta ficha pasa a «explotada» y te avisamos en el boletín.
Versiones afectadas
- Linux Afectadas: 7270cc9157f474dfc46750a34c9d7defc686b2eb y anteriores a be54a70067c7dbe1381157e8a238fa4b16ea9c05 · 7270cc9157f474dfc46750a34c9d7defc686b2eb y anteriores a 1c9fca34b9625a67a7f1a03c8604f3df760c6c49 · 7270cc9157f474dfc46750a34c9d7defc686b2eb y anteriores a 8053393680d4fa3eb962667d2be95dd39f0940e5
- Linux Afectadas: 6.16 No afectadas: 6.18.51 · 7.2.5 · 7.3
Según el registro de la vulnerabilidad en CVE.org, tal como lo publicó el fabricante. Confirma tu versión exacta en el aviso del fabricante.
Referencias
- Referencia en git.kernel.orggit.kernel.org/stable/c/be54a70067c7dbe1381157e8a238fa4b16ea9c05
- Referencia en git.kernel.orggit.kernel.org/stable/c/1c9fca34b9625a67a7f1a03c8604f3df760c6c49
- Referencia en git.kernel.orggit.kernel.org/stable/c/8053393680d4fa3eb962667d2be95dd39f0940e5
Ver el texto original en inglés (CVE.org)
KVM: arm64: Handle negative S1 walk levels in VNCR TLB size evaluation
In the Linux kernel, the following vulnerability has been resolved: KVM: arm64: Handle negative S1 walk levels in VNCR TLB size evaluation Computing the effects of a TLB invalidation involves looking at the size of the mapping cached by the TLB. For S1 mappings such as VNCR, this is deducted from the combination of the base granule size and the mapping level. However, this implies that the S1 MMU is *on*. When the MMU is off, we indicate this with the level being set to a "creative" value of -127 (S1_MMU_DISABLED). This ends-up being misinterpreted by pgshift_level_to_ttl() as it doesn't handle negative levels at all (the level is immediately cast to a u8 and only the bottom two bits considered), leading to an invalidation size of 0. Not helpful. Tidy-up pgshift_level_to_ttl() to handle these negative levels, and ttl_to_size() to always return SZ_1G when no valid TTL is present. This allows the removal of open-coded checks for similar situations. Note that the check for a negative value not explicitely checking for S1_MMU_DISABLED is deliberate, so that actual negative levels introduced with LVA2 and D128 can take the same path if we ever support them.