Descripción
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: mpls: recargar el encabezado después de pskb_may_pull() mpls_select_multipath() llama a mpls_multipath_hash() para elegir un nexthop cuando una ruta MPLS tiene varios nexthops. Al recorrer la pila de etiquetas MPLS, la rutina de hash guarda en caché hdr para la etiqueta actual. Después de encontrar la etiqueta de fondo de pila, llama a pskb_may_pull() antes de leer el encabezado IP interno. Si se construye un skb con el encabezado IP interno en datos no lineales y sin suficiente tailroom en la cabecera lineal, pskb_may_pull() llama a pskb_expand_head() para reemplazar la cabecera del skb y liberar la anterior. Esto deja a hdr apuntando a memoria liberada. La ruta IPv6 puede invalidar hdr nuevamente al realizar un segundo pull para el encabezado más grande. El problema se encontró mediante análisis estático. Un reproductor que envía un paquete Geneve legítimo a través de una configuración multipath bareudp/MPLS desencadenó el mismo reporte de KASAN en 2 de 2 ejecuciones sin parche: BUG: KASAN: slab-use-after-free in mpls_select_multipath Read of size 1 at addr ffff88800ecc6e20 by task ksoftirqd/1/23 Call Trace: mpls_select_multipath mpls_forward __netif_receive_skb_list_core netif_receive_skb_list_internal napi_complete_done gro_cell_poll __napi_poll net_rx_action Freed by task 23: kfree pskb_expand_head __pskb_pull_tail mpls_select_multipath Se recarga hdr desde la cabecera actual del skb después de cada pull exitoso, antes de derivar el puntero al encabezado IPv4 o IPv6 interno.
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: 9f427a0e474a67b454420c131709600d44850486 y anteriores a aa4fe0b450a461aa1162fe8375f5d28f4c957df8 · 9f427a0e474a67b454420c131709600d44850486 y anteriores a b1c0783b2facc398437ad8f8b86c636d7a78f8db · 9f427a0e474a67b454420c131709600d44850486 y anteriores a bfaaff99238326166694354a63a76c02563f98b1 · 9f427a0e474a67b454420c131709600d44850486 y anteriores a d9640239827d6d0cb84263b590f7a4f1596c17eb · 9f427a0e474a67b454420c131709600d44850486 y anteriores a fed638a248116b8a249bd4202d28e5934bdc65ad · 9f427a0e474a67b454420c131709600d44850486 y anteriores a d82b90a38c2ca8a0694428eab0e9551c23f2447d · 9f427a0e474a67b454420c131709600d44850486 y anteriores a 49d38c1b4390412f8950d33dfaee0ccbd17beb81 · 9f427a0e474a67b454420c131709600d44850486 y anteriores a 29e63b8d9fc150cc191b1c6eb7e16e1247e1b650 · ad864d9fce0ec56cc8f6afe5c6a0e6d7f484b9eb · 4.9.8 y anteriores a 4.10
- Linux Afectadas: 4.10 No afectadas: 5.10.270 · 5.15.221 · 6.1.188 · 6.6.157 · 6.12.109 · 6.18.50
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/aa4fe0b450a461aa1162fe8375f5d28f4c957df8
- Referencia en git.kernel.orggit.kernel.org/stable/c/b1c0783b2facc398437ad8f8b86c636d7a78f8db
- Referencia en git.kernel.orggit.kernel.org/stable/c/bfaaff99238326166694354a63a76c02563f98b1
- Referencia en git.kernel.orggit.kernel.org/stable/c/d9640239827d6d0cb84263b590f7a4f1596c17eb
- Referencia en git.kernel.orggit.kernel.org/stable/c/fed638a248116b8a249bd4202d28e5934bdc65ad
- Referencia en git.kernel.orggit.kernel.org/stable/c/d82b90a38c2ca8a0694428eab0e9551c23f2447d
- Referencia en git.kernel.orggit.kernel.org/stable/c/49d38c1b4390412f8950d33dfaee0ccbd17beb81
- Referencia en git.kernel.orggit.kernel.org/stable/c/29e63b8d9fc150cc191b1c6eb7e16e1247e1b650
Ver el texto original en inglés (CVE.org)
mpls: reload header after pskb_may_pull()
In the Linux kernel, the following vulnerability has been resolved: mpls: reload header after pskb_may_pull() mpls_select_multipath() calls mpls_multipath_hash() to choose a nexthop when an MPLS route has multiple nexthops. While walking the MPLS label stack, the hash routine caches hdr for the current label. After finding the bottom-of-stack label, it calls pskb_may_pull() before reading the inner IP header. If an skb is constructed with the inner IP header in nonlinear data and insufficient tailroom in the linear head, pskb_may_pull() calls pskb_expand_head() to replace the skb head and free the old one. This leaves hdr pointing to freed memory. The IPv6 path can invalidate hdr again when it performs a second pull for the larger header. The issue was found through static analysis. A reproducer sending a legal Geneve packet through a bareudp/MPLS multipath setup triggered the same KASAN report in 2 of 2 unpatched runs: BUG: KASAN: slab-use-after-free in mpls_select_multipath Read of size 1 at addr ffff88800ecc6e20 by task ksoftirqd/1/23 Call Trace: mpls_select_multipath mpls_forward __netif_receive_skb_list_core netif_receive_skb_list_internal napi_complete_done gro_cell_poll __napi_poll net_rx_action Freed by task 23: kfree pskb_expand_head __pskb_pull_tail mpls_select_multipath Reload hdr from the current skb head after each successful pull before deriving the inner IPv4 or IPv6 header pointer.