netfilter: nf_tables: prefer nft_chain_validate
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 20a69341f2d00cd042e81c82289fba8a13c05a25 · < 717c91c6ed73e248de6a15bc53adefb81446c9d0| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_tables: prefer nft_chain_validate
nft_chain_validate already performs loop detection because a cycle will result in a call stack overflow (ctx->level >= NFT_JUMP_STACK_SIZE).
It also follows maps via ->validate callback in nft_lookup, so there appears no reason to iterate the maps again.
nf_tables_check_loops() and all its helper functions can be removed. This improves ruleset load time significantly, from 23s down to 12s.
This also fixes a crash bug. Old loop detection code can result in unbounded recursion:
BUG: TASK stack guard page was hit at .... Oops: stack guard page: 0000 [#1] PREEMPT SMP KASAN CPU: 4 PID: 1539 Comm: nft Not tainted 6.10.0-rc5+ #1 [..]
with a suitable ruleset during validation of register stores.
From the CVE record · Linux
The Linux kernel's nf_tables loop detection can recurse without bound while validating register stores, causing a stack guard page crash. A suitable ruleset can trigger the crash; the input does not specify whether the attacker needs local access, authentication, or user interaction.
Engineers running Linux kernels with the affected nf_tables code should check their kernel versions; affected versions are not specified.