ipv4: avoid divide by zero in fib_rebalance
Impact
In the Linux kernel, the following vulnerability has been resolved:
Source excerpt · LinuxAffected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
Linux · Linux
Other versions: unaffected
| Version / range | Source status |
|---|---|
| 0e884c78ee19e902f300ed147083c28a0c6302f0 to before 5dac5c7ba8f5f3fb4bf29f2a2c3cb552f5b83c8f | affected |
| 0e884c78ee19e902f300ed147083c28a0c6302f0 to before d5520e815c4b1427104ce1428ee23821f2aa824d | affected |
| 0e884c78ee19e902f300ed147083c28a0c6302f0 to before 5046d2880fec7d49ebed2fd2866747ee1d06ad71 | affected |
Linux · Linux
Other versions: affected
| Version / range | Source status |
|---|---|
| 4.4 | affected |
| 0 to before 4.4 | unaffected |
| 6.18.59 through 6.18.* (inclusive) | unaffected |
| 7.2.13 through 7.2.* (inclusive) | unaffected |
| 7.3 through * (inclusive) | unaffected |
Original source description
In the Linux kernel, the following vulnerability has been resolved:
ipv4: avoid divide by zero in fib_rebalance
fib_rebalance() computes the total eligible nexthop weight in one pass and programs upper bounds in a second pass. A concurrent change to ignore_routes_with_linkdown can make the first pass return zero while the second pass sees an eligible nexthop, resulting in division by zero.
If the first pass reports a zero total, set each nexthop upper bound to -1 and skip the division. This matches the IPv6 fix in commit d2c26c2911dd ("ipv6: avoid divide by zero in rt6_multipath_rebalance") and preserves the lock-free rebalance path.