// For flags

CVE-2024-35884

udp: do not accept non-tunnel GSO skbs landing in a tunnel

Severity Score

8.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Track
*SSVC
Descriptions

In the Linux kernel, the following vulnerability has been resolved:

udp: do not accept non-tunnel GSO skbs landing in a tunnel

When rx-udp-gro-forwarding is enabled UDP packets might be GROed when
being forwarded. If such packets might land in a tunnel this can cause
various issues and udp_gro_receive makes sure this isn't the case by
looking for a matching socket. This is performed in
udp4/6_gro_lookup_skb but only in the current netns. This is an issue
with tunneled packets when the endpoint is in another netns. In such
cases the packets will be GROed at the UDP level, which leads to various
issues later on. The same thing can happen with rx-gro-list.

We saw this with geneve packets being GROed at the UDP level. In such
case gso_size is set; later the packet goes through the geneve rx path,
the geneve header is pulled, the offset are adjusted and frag_list skbs
are not adjusted with regard to geneve. When those skbs hit
skb_fragment, it will misbehave. Different outcomes are possible
depending on what the GROed skbs look like; from corrupted packets to
kernel crashes.

One example is a BUG_ON[1] triggered in skb_segment while processing the
frag_list. Because gso_size is wrong (geneve header was pulled)
skb_segment thinks there is "geneve header size" of data in frag_list,
although it's in fact the next packet. The BUG_ON itself has nothing to
do with the issue. This is only one of the potential issues.

Looking up for a matching socket in udp_gro_receive is fragile: the
lookup could be extended to all netns (not speaking about performances)
but nothing prevents those packets from being modified in between and we
could still not find a matching socket. It's OK to keep the current
logic there as it should cover most cases but we also need to make sure
we handle tunnel packets being GROed too early.

This is done by extending the checks in udp_unexpected_gso: GSO packets
lacking the SKB_GSO_UDP_TUNNEL/_CSUM bits and landing in a tunnel must
be segmented.

[1] kernel BUG at net/core/skbuff.c:4408!
RIP: 0010:skb_segment+0xd2a/0xf70
__udp_gso_segment+0xaa/0x560

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: udp: no acepte skbs GSO que no sean de túnel que aterricen en un túnel Cuando rx-udp-gro-forwarding está habilitado, los paquetes UDP pueden recibir GRO al reenviarse. Si dichos paquetes pudieran aterrizar en un túnel, esto puede causar varios problemas y udp_gro_receive se asegura de que este no sea el caso buscando un socket coincidente. Esto se realiza en udp4/6_gro_lookup_skb pero sólo en las redes actuales. Este es un problema con los paquetes tunelizados cuando el punto final está en otra red. En tales casos, los paquetes se almacenarán en el nivel UDP, lo que generará varios problemas más adelante. Lo mismo puede pasar con rx-gro-list. Vimos esto con paquetes geneve siendo GRO en el nivel UDP. En tal caso, se establece gso_size; luego, el paquete pasa por la ruta geneve rx, se extrae el encabezado geneve, se ajusta el desplazamiento y los skbs frag_list no se ajustan con respecto a geneve. Cuando esos skbs lleguen a skb_fragment, se comportará mal. Son posibles diferentes resultados dependiendo del aspecto de los skbs GROed; desde paquetes corruptos hasta fallas del kernel. Un ejemplo es un BUG_ON[1] activado en skb_segment mientras se procesa frag_list. Debido a que gso_size es incorrecto (se extrajo el encabezado geneve), skb_segment cree que hay un "tamaño de encabezado geneve" de datos en frag_list, aunque en realidad es el siguiente paquete. El BUG_ON en sí no tiene nada que ver con el problema. Éste es sólo uno de los posibles problemas. Buscar un socket coincidente en udp_gro_receive es frágil: la búsqueda podría extenderse a todas las redes (sin hablar de rendimiento), pero nada impide que esos paquetes se modifiquen en el medio y todavía no pudimos encontrar un socket coincidente. Está bien mantener la lógica actual allí, ya que debería cubrir la mayoría de los casos, pero también debemos asegurarnos de manejar los paquetes de túnel que se procesan en GRO demasiado pronto. Esto se hace ampliando las comprobaciones en udp_unexpected_gso: los paquetes OSG que carecen de los bits SKB_GSO_UDP_TUNNEL/_CSUM y que aterrizan en un túnel deben segmentarse. [1] ¡BUG del kernel en net/core/skbuff.c:4408! RIP: 0010:skb_segment+0xd2a/0xf70 __udp_gso_segment+0xaa/0x560

CVE-2024-35884 highlights a flaw in the Linux kernel's handling of UDP packets when Generic Receive Offload (GRO) forwarding is enabled. The issue occurs because non-tunnel UDP packets are sometimes mistakenly processed as if they belong to a tunnel. This can lead to data corruption or kernel crashes, particularly in environments with complex network configurations or when certain tunneling protocols like Geneve are used.

The kernel's processing logic for GRO and UDP packets fails to properly differentiate between tunneled and non-tunneled packets. As a result, improperly handled packets may lead to segmentation errors or system instability.

This vulnerability affects system availability and could result in crashes or data integrity issues during packet forwarding.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
* Common Vulnerability Scoring System
SSVC
  • Decision:Track
Exploitation
None
Automatable
No
Tech. Impact
Partial
* Organization's Worst-case Scenario
Timeline
  • 2024-05-17 CVE Reserved
  • 2024-05-19 CVE Published
  • 2024-05-20 EPSS Updated
  • 2024-12-19 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 5.6 < 5.10.215
Search vendor "Linux" for product "Linux Kernel" and version " >= 5.6 < 5.10.215"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 5.6 < 5.15.154
Search vendor "Linux" for product "Linux Kernel" and version " >= 5.6 < 5.15.154"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 5.6 < 6.1.85
Search vendor "Linux" for product "Linux Kernel" and version " >= 5.6 < 6.1.85"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 5.6 < 6.6.26
Search vendor "Linux" for product "Linux Kernel" and version " >= 5.6 < 6.6.26"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 5.6 < 6.8.5
Search vendor "Linux" for product "Linux Kernel" and version " >= 5.6 < 6.8.5"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 5.6 < 6.9
Search vendor "Linux" for product "Linux Kernel" and version " >= 5.6 < 6.9"
en
Affected