8.8high
netfilter: bridge: confirm multicast packets before passing them up the stack
- Severity
- 8.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.25% (higher than 17% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: netfilter: bridge: confirm multicast packets before passing them up the stack conntrack nf_confirm logic cannot handle cloned skbs referencing the same nf_conn entry, which will happen for multicast (broadcast) frames on bridges. Example: macvlan0 | br0 / \ ethX ethY ethX (or Y) receives a L2 multicast or broadcast packet containing an IP packet, flow is not yet in conntrack table. 1. skb passes through bridge and fake-ip (br_netfilter)Prerouting. -> skb->_nfct now references a unconfirmed entry 2. skb is broad/mcast packet. bridge now passes clones out on each bridge interface. 3. skb gets passed up the stack. 4. In macvlan case, macvlan driver retains clone(s) of the mcast skb and schedules a work queue to send them out on the lower devices. The clone skb->_nfct is not a copy, it is the same entry as the original skb. The macvlan rx handler then returns RX_HANDLER_PASS. 5. Normal conntrack hooks (in NF_INET_LOCAL_IN) confirm the orig skb. The Macvlan broadcast worker and normal confirm path will race. This race will not happen if step 2 already confirmed a clone. In that case later steps perform skb_clone() with skb->_nfct already confirmed (in hash table). This works fine. But such confirmation won't happen when eb/ip/nftables rules dropped the packets before they reached the nf_confirm step in postrouting. Pablo points out that nf_conntrack_bridge doesn't allow use of stateful nat, so we can safely discard the nf_conn entry and let inet call conntrack again. This doesn't work for bridge netfilter: skb could have a nat transformation. Also bridge nf prevents re-invocation of inet prerouting via 'sabotage_in' hook. Work around this problem by explicit confirmation of the entry at LOCAL_IN time, before upper layer has a chance to clone the unconfirmed entry. The downside is that this disables NAT and conntrack helpers. Alternative fix would be to add locking to all code parts that deal with unconfirmed packets, but even if that could be done in a sane way this opens up other problems, for example: -m physdev --physdev-out eth0 -j SNAT --snat-to 1.2.3.4 -m physdev --physdev-out eth1 -j SNAT --snat-to 1.2.3.5 For multicast case, only one of such conflicting mappings will be created, conntrack only handles 1:1 NAT mappings. Users should set create a setup that explicitly marks such traffic NOTRACK (conntrack bypass) to avoid this, but we cannot auto-bypass them, ruleset might have accept rules for untracked traffic already, so user-visible behaviour would change.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 7c3f28599652acf431a2211168de4a583f30b6d5, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 2b1414d5e94e477edff1d2c79030f1d742625ea0, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 80cd0487f630b5382734997c3e5e3003a77db315, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before cb734975b0ffa688ff6cc0eed463865bf07b6c01, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 62e7151ae3eb465e0ab52a20c941ff33bb6332e9, 2.6.12 Not affected: before 2.6.12, from 5.15.151 up to 5.15.*, from 6.1.81 up to 6.1.*, from 6.6.21 up to 6.6.*, from 6.7.9 up to 6.7.*, from 6.8 up to * | CVE List |
| linux linux_kernel | from 2.6.13 before 5.15.151, from 5.16 before 6.1.81, from 6.2 before 6.6.21, from 6.7 before 6.7.9, 2.6.12, 6.8 | NVD |
All scores
| Linux | 8.8high CVSS:3.1 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 4.7medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: netfilter: bridge: confirm multicast packets before passing them up the stack conntrack nf_confirm logic cannot handle cloned skbs referencing the same nf_conn entry, which will happen for multicast (broadcast) frames on bridges. Example: macvlan0 | br0 / \ ethX ethY ethX (or Y) receives a L2 multicast or broadcast packet containing an IP packet, flow is not yet in conntrack table. 1. skb passes through bridge and fake-ip (br_netfilter)Prerouting. -> skb->_nfct now references a unconfirmed entry 2. skb is broad/mcast packet. bridge now passes clones out on each bridge interface. 3. skb gets passed up the stack. 4. In macvlan case, macvlan driver retains clone(s) of the mcast skb and schedules a work queue to send them out on the lower devices. The clone skb->_nfct is not a copy, it is the same entry as the original skb. The macvlan rx handler then returns RX_HANDLER_PASS. 5. Normal conntrack hooks (in NF_INET_LOCAL_IN) confirm the orig skb. The Macvlan broadcast worker and normal confirm path will race. This race will not happen if step 2 already confirmed a clone. In that case later steps perform skb_clone() with skb->_nfct already confirmed (in hash table). This works fine. But such confirmation won't happen when eb/ip/nftables rules dropped the packets before they reached the nf_confirm step in postrouting. Pablo points out that nf_conntrack_bridge doesn't allow use of stateful nat, so we can safely discard the nf_conn entry and let inet call conntrack again. This doesn't work for bridge netfilter: skb could have a nat transformation. Also bridge nf prevents re-invocation of inet prerouting via 'sabotage_in' hook. Work around this problem by explicit confirmation of the entry at LOCAL_IN time, before upper layer has a chance to clone the unconfirmed entry. The downside is that this disables NAT and conntrack helpers. Alternative fix would be to add locking to all code parts that deal with unconfirmed packets, but even if that could be done in a sane way this opens up other problems, for example: -m physdev --physdev-out eth0 -j SNAT --snat-to 1.2.3.4 -m physdev --physdev-out eth1 -j SNAT --snat-to 1.2.3.5 For multicast case, only one of such conflicting mappings will be created, conntrack only handles 1:1 NAT mappings. Users should set create a setup that explicitly marks such traffic NOTRACK (conntrack bypass) to avoid this, but we cannot auto-bypass them, ruleset might have accept rules for untracked traffic already, so user-visible behaviour would change.
NVD (es)
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: netfilter: bridge: confirme los paquetes de multidifusión antes de pasarlos a la pila conntrack La lógica nf_confirm no puede manejar skbs clonados que hagan referencia a la misma entrada nf_conn, lo que sucederá con las tramas de multidifusión (difusión) en puentes. Ejemplo: macvlan0 | br0 / \ ethX ethY ethX (o Y) recibe un paquete de multidifusión o difusión L2 que contiene un paquete IP, el flujo aún no está en la tabla conntrack. 1. skb pasa por el puente y el enrutamiento previo de IP falsa (br_netfilter). -> skb->_nfct ahora hace referencia a una entrada no confirmada 2. skb es un paquete amplio/mcast. El puente ahora pasa clones en cada interfaz del puente. 3. skb pasa a la pila. 4. En el caso de macvlan, el controlador macvlan conserva los clones del skb mcast y programa una cola de trabajo para enviarlos a los dispositivos inferiores. El clon skb->_nfct no es una copia, es la misma entrada que el skb original. El controlador macvlan rx luego devuelve RX_HANDLER_PASS. 5. Los ganchos de conexión normales (en NF_INET_LOCAL_IN) confirman el skb original. El trabajador de transmisión de Macvlan y la ruta de confirmación normal correrán. Esta carrera no se realizará si el paso 2 ya confirmó un clon. En ese caso, los pasos posteriores realizan skb_clone() con skb->_nfct ya confirmado (en la tabla hash). Esto funciona bien. Pero dicha confirmación no ocurrirá cuando las reglas eb/ip/nftables eliminen los paquetes antes de que alcancen el paso nf_confirm en el posenrutamiento. Pablo señala que nf_conntrack_bridge no permite el uso de nat con estado, por lo que podemos descartar con seguridad la entrada nf_conn y dejar que inet llame a conntrack nuevamente. Esto no funciona para bridge netfilter: skb podría tener una transformación nat. Además, bridge nf evita la reinvocación del enrutamiento previo de inet a través del gancho 'sabotage_in'. Evite este problema confirmando explícitamente la entrada en el momento LOCAL_IN, antes de que la capa superior tenga la oportunidad de clonar la entrada no confirmada. La desventaja es que esto desactiva NAT y los asistentes de conexión. Una solución alternativa sería agregar bloqueo a todas las partes del código que tratan con paquetes no confirmados, pero incluso si eso pudiera hacerse de manera sensata, esto abre otros problemas, por ejemplo: -m physdev --physdev-out eth0 -j SNAT - -snat-to 1.2.3.4 -m physdev --physdev-out eth1 -j SNAT --snat-to 1.2.3.5 Para el caso de multidifusión, solo se creará una de estas asignaciones conflictivas, conntrack solo maneja asignaciones NAT 1:1. Los usuarios deben crear una configuración que marque explícitamente dicho tráfico NOTRACK (omisión de conntrack) para evitar esto, pero no podemos omitirlos automáticamente, es posible que el conjunto de reglas ya haya aceptado reglas para el tráfico sin seguimiento, por lo que el comportamiento visible para el usuario cambiaría.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-27415 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2024-27415 changed 2026-08-04 | Public domain |