CVE-2025-21768: net: ipv6: fix dst ref loops in rpl, seg6 and ioam6 lwtunnels
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: ipv6: fix dst ref loops in rpl, seg6 and ioam6 lwtunnels
Some lwtunnels have a dst cache for post-transformation dst. If the packet destination did not change we may end up recording a reference to the lwtunnel in its own cache, and the lwtunnel state will never be freed.
Discovered by the ioam6.sh test, kmemleak was recently fixed to catch per-cpu memory leaks. I'm not sure if rpl and seg6 can actually hit this, but in principle I don't see why not.
The Linux kernel CVE team has assigned CVE-2025-21768 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.10 with commit 6c8702c60b88651072460f3f4026c7dfe2521d12 and fixed in 6.12.16 with commit 5ab11a4e219e93b8b31a27f8ec98d42afadd8b7a Issue introduced in 4.10 with commit 6c8702c60b88651072460f3f4026c7dfe2521d12 and fixed in 6.13.4 with commit 4c0f200c7d06fedddde82209c099014d63f4a6c0 Issue introduced in 4.10 with commit 6c8702c60b88651072460f3f4026c7dfe2521d12 and fixed in 6.14-rc2 with commit 92191dd1073088753821b862b791dcc83e558e07
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-21768
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/ipv6/ioam6_iptunnel.c
net/ipv6/rpl_iptunnel.c
net/ipv6/seg6_iptunnel.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/5ab11a4e219e93b8b31a27f8ec98d42afadd8b7a https://git.kernel.org/stable/c/4c0f200c7d06fedddde82209c099014d63f4a6c0 https://git.kernel.org/stable/c/92191dd1073088753821b862b791dcc83e558e07