5.5medium
netfilter: nf_tables: avoid chain re-validation if possible
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.18% (higher than 7% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_tables: avoid chain re-validation if possible Hamza Mahfooz reports cpu soft lock-ups in nft_chain_validate(): watchdog: BUG: soft lockup - CPU#1 stuck for 27s! [iptables-nft-re:37547] [..] RIP: 0010:nft_chain_validate+0xcb/0x110 [nf_tables] [..] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_table_validate+0x6b/0xb0 [nf_tables] nf_tables_validate+0x8b/0xa0 [nf_tables] nf_tables_commit+0x1df/0x1eb0 [nf_tables] [..] Currently nf_tables will traverse the entire table (chain graph), starting from the entry points (base chains), exploring all possible paths (chain jumps). But there are cases where we could avoid revalidation. Consider: 1 input -> j2 -> j3 2 input -> j2 -> j3 3 input -> j1 -> j2 -> j3 Then the second rule does not need to revalidate j2, and, by extension j3, because this was already checked during validation of the first rule. We need to validate it only for rule 3. This is needed because chain loop detection also ensures we do not exceed the jump stack: Just because we know that j2 is cycle free, its last jump might now exceed the allowed stack size. We also need to update all reachable chains with the new largest observed call depth. Care has to be taken to revalidate even if the chain depth won't be an issue: chain validation also ensures that expressions are not called from invalid base chains. For example, the masquerade expression can only be called from NAT postrouting base chains. Therefore we also need to keep record of the base chain context (type, hooknum) and revalidate if the chain becomes reachable from a different hook location.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from a654de8fdc1815676ab750e70cab231fc814c29f before 53de1e6cde8f9b791d9cf61aa0e7b02cf5bbe8b1, from a654de8fdc1815676ab750e70cab231fc814c29f before 14fa3d1927f1382f86e3f70a51f26005c8e3cff6, from a654de8fdc1815676ab750e70cab231fc814c29f before 09d6074995c186e449979fe6c1b0f1a69cf9bd3b, from a654de8fdc1815676ab750e70cab231fc814c29f before 8e1a1bc4f5a42747c08130b8242ebebd1210b32f, 4.18 Not affected: before 4.18, from 6.6.121 up to 6.6.*, from 6.12.66 up to 6.12.*, from 6.18.6 up to 6.18.*, from 6.19 up to * | CVE List |
| linux linux_kernel | from 4.18 before 6.6.121, from 6.7 before 6.12.66, from 6.13 before 6.18.6, 6.19 | NVD |
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: nf_tables: avoid chain re-validation if possible Hamza Mahfooz reports cpu soft lock-ups in nft_chain_validate(): watchdog: BUG: soft lockup - CPU#1 stuck for 27s! [iptables-nft-re:37547] [..] RIP: 0010:nft_chain_validate+0xcb/0x110 [nf_tables] [..] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_table_validate+0x6b/0xb0 [nf_tables] nf_tables_validate+0x8b/0xa0 [nf_tables] nf_tables_commit+0x1df/0x1eb0 [nf_tables] [..] Currently nf_tables will traverse the entire table (chain graph), starting from the entry points (base chains), exploring all possible paths (chain jumps). But there are cases where we could avoid revalidation. Consider: 1 input -> j2 -> j3 2 input -> j2 -> j3 3 input -> j1 -> j2 -> j3 Then the second rule does not need to revalidate j2, and, by extension j3, because this was already checked during validation of the first rule. We need to validate it only for rule 3. This is needed because chain loop detection also ensures we do not exceed the jump stack: Just because we know that j2 is cycle free, its last jump might now exceed the allowed stack size. We also need to update all reachable chains with the new largest observed call depth. Care has to be taken to revalidate even if the chain depth won't be an issue: chain validation also ensures that expressions are not called from invalid base chains. For example, the masquerade expression can only be called from NAT postrouting base chains. Therefore we also need to keep record of the base chain context (type, hooknum) and revalidate if the chain becomes reachable from a different hook location.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: netfilter: nf_tables: evitar la revalidación de cadenas si es posible Hamza Mahfooz informa de bloqueos suaves de CPU en nft_chain_validate(): watchdog: BUG: soft lockup - CPU#1 atascada durante 27s! [iptables-nft-re:37547] [..] RIP: 0010:nft_chain_validate+0xcb/0x110 [nf_tables] [..] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_immediate_validate+0x36/0x50 [nf_tables] nft_chain_validate+0xc9/0x110 [nf_tables] nft_table_validate+0x6b/0xb0 [nf_tables] nf_tables_validate+0x8b/0xa0 [nf_tables] nf_tables_commit+0x1df/0x1eb0 [nf_tables] [..] Actualmente, nf_tables recorrerá toda la tabla (grafo de cadenas), comenzando desde los puntos de entrada (cadenas base), explorando todas las rutas posibles (saltos de cadena). Pero hay casos en los que podríamos evitar la revalidación. Considere: 1 input -> j2 -> j3 2 input -> j2 -> j3 3 input -> j1 -> j2 -> j3 Entonces la segunda regla no necesita revalidar j2, y, por extensión j3, porque esto ya fue verificado durante la validación de la primera regla. Necesitamos validarlo solo para la regla 3. Esto es necesario porque la detección de bucles de cadena también asegura que no excedamos la pila de saltos: Solo porque sabemos que j2 está libre de ciclos, su último salto podría ahora exceder el tamaño de pila permitido. También necesitamos actualizar todas las cadenas alcanzables con la nueva profundidad de llamada más grande observada. Se debe tener cuidado de revalidar incluso si la profundidad de la cadena no será un problema: la validación de la cadena también asegura que las expresiones no se llamen desde cadenas base inválidas. Por ejemplo, la expresión de enmascaramiento solo puede ser llamada desde cadenas base de postrouting NAT. Por lo tanto, también necesitamos mantener un registro del contexto de la cadena base (tipo, hooknum) y revalidar si la cadena se vuelve alcanzable desde una ubicación de hook diferente.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-71160 changed 2026-11-05 | CVE Terms of Use |
| NVD | CVE-2025-71160 changed 2026-11-05 | Public domain |