ipv4: fib: bound automatic table ID allocation
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b801f54917b7c6e8540f877ee562cd0725e62ebd · < fe9a906d2bff2d2707bafd6353b5e032a42aeb35| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ipv4: fib: bound automatic table ID allocation
fib_empty_table() probes every table ID from 1 until it finds a free one. IPv4 tables are stored in a 256-bucket hash table, so a dense set of IDs makes each probe walk a growing hash chain while RTNL is held.
Automatic table assignment ("ip rule ... table 0") is an IPv4-only legacy path. Bound the automatically allocated ID to 4096 so the RTNL hold stays bounded, without changing lookups of explicitly specified table IDs.
This changes user-visible behavior. A table-0 rule previously received the lowest free ID in 1..RT_TABLE_MAX (0xFFFFFFFF). After this patch the search stops at 4096 and the rule add fails with ENOBUFS if that range is fully occupied. Explicit table IDs above 4096 remain usable.
The automatic path is unused in practice: it is IPv4-only, not documented by ip-rule, uncovered by kernel selftests, and both NetworkManager and systemd refuse table 0.
From the CVE record · Linux
The Linux kernel’s IPv4 automatic routing-table ID allocator can spend a long time searching dense table IDs while holding the RTNL lock. A local actor who can add an IPv4 rule using table 0 could trigger this behavior; the input does not specify the required privileges.
Engineers running Linux kernels that support automatic IPv4 table ID allocation should check their affected versions against the vendor advisory.