ipv4: Fix fib_nlmsg_size() for RTA_VIA nexthops
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d15662682db232da77136cd348f4c9df312ca6f9 · < a59edda6eda1252340354322d8ab318b2e9052fb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ipv4: Fix fib_nlmsg_size() for RTA_VIA nexthops
fib_nlmsg_size() still estimates nexthop space as if every gateway is encoded as an IPv4 RTA_GATEWAY attribute. IPv4 routes can also carry an IPv6 gateway, which fib_nexthop_info() dumps as RTA_VIA.
As a result, route notifications can allocate an skb that is too small. fib_dump_info() then fails with -EMSGSIZE and rtmsg_fib() hits the WARN_ON() that marks such failures as a fib_nlmsg_size() bug. With panic_on_warn set, this becomes a kernel panic.
Mirror the actual nexthop dump layout in fib_nlmsg_size(): account for IPv6 nexthop gateways dumped as RTA_VIA, for the no-header rtnexthop layout used inside RTA_MULTIPATH, and for RTA_FLOW only when it is actually present.
From the CVE record · Linux
The Linux kernel can underestimate the space needed for route notifications involving IPv4 routes with IPv6 nexthop gateways. This can trigger a kernel warning and, if panic_on_warn is set, a kernel panic. The input does not specify whether an attacker needs local access, authentication, or user interaction to trigger it.
Operators running the Linux kernel should check their systems; affected versions are not specified.