Linux: ipv4: stop PMTU walk when nexthop group shrinks
What fixes it
- 7fd60d3c9a1e1b11ef5f1643bbae78d91eae2f4aLinuxCVE List
- 6619e01855e65ef35723685a557e3eb106f4ecf5LinuxCVE List
- 6.6.160LinuxCVE List
- 6.12.113LinuxCVE List
- 5.16LinuxCVE List
- 6.2LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
ipv4: stop PMTU walk when nexthop group shrinks
Commit 7d3f3b4367f3 ("net: ipv4: Cache pmtu for all packet paths if multipath enabled") made __ip_rt_update_pmtu() update every path.
For nexthop objects, fib_info_num_path() and fib_info_nhc() independently load nh->nh_grp. RCU protects each group's lifetime but does not make the loads observe the same group. If replacement shrinks the group after the loop accepts an index, fib_info_nhc() returns NULL and update_or_create_fnhe() dereferences it.
A deterministic probe only widened the existing window between the real operations. On v7.2, an RTM_NEWNEXTHOP replacement published a one-member group after the PMTU reader accepted index 1 from a two-member group, producing:
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: update_or_create_fnhe+0x45/0x15b0
Stop when the indexed path is absent. Groups are dense, so no later index exists in that snapshot. The same real-writer window completed 114,423 PMTU iterations without an oops with this check. A reproducer is available on request.
Replacement requires CAP_NET_ADMIN in the network namespace. Where unprivileged user namespaces are permitted, a local user can obtain it in a new user and network namespace.
Text from CVE List
Affected versions 18
- Linuxaffected: 3bed2abab4a682d426624ce9add9d7b6d475d4e4 before 7fd60d3c9a1e1b11ef5f1643bbae78d91eae2f4aCVE List
- Linuxaffected: 7f5005457b3072fe1ddf15bfef869f2a1d98e05e before c60d17d6dd61adc761ac6f65a008fefbc54cbf87CVE List
- Linuxaffected: 7d3f3b4367f315a61fc615e3138f3d320da8c466 before c6d670ac656badfd0e15355e07a13a6bdf3b69fdCVE List
- Linuxaffected: 7d3f3b4367f315a61fc615e3138f3d320da8c466 before f27483f9975b5065ff67054cc7eb8edac6083488CVE List
- Linuxaffected: 7d3f3b4367f315a61fc615e3138f3d320da8c466 before 6619e01855e65ef35723685a557e3eb106f4ecf5CVE List
- Linuxaffected: fc07a232326a623d0be482e307c08ea7049c2846CVE List
- Linuxaffected: b1f7bdee5750d6cbb9497140cd6582abc5fdcb9eCVE List
- Linuxaffected: 6.6.79 before 6.6.160CVE List
- Linuxaffected: 6.12.16 before 6.12.113CVE List
- Linuxaffected: 5.15.179 before 5.16CVE List
- Linuxaffected: 6.1.129 before 6.2CVE List
- Linuxaffected: 6.13CVE List
- Linuxunaffected: all versions before 6.13CVE List
- Linuxunaffected: 6.6.160 through 6.6.*CVE List
- Linuxunaffected: 6.12.113 through 6.12.*CVE List
- Linuxunaffected: 6.18.57 through 6.18.*CVE List
- Linuxunaffected: 7.2.11 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 5
- git.kernel.org/stable/c/7fd60d3c9a1e1b11ef5f1643bbae78d91eae2f4aReferencevia CVE List
- git.kernel.org/stable/c/c60d17d6dd61adc761ac6f65a008fefbc54cbf87Referencevia CVE List
- git.kernel.org/stable/c/c6d670ac656badfd0e15355e07a13a6bdf3b69fdReferencevia CVE List
- git.kernel.org/stable/c/f27483f9975b5065ff67054cc7eb8edac6083488Referencevia CVE List
- git.kernel.org/stable/c/6619e01855e65ef35723685a557e3eb106f4ecf5Referencevia CVE List