CVE-2025-40158
Description
In the Linux kernel, the following vulnerability has been resolved:
ipv6: use RCU in ip6_output()
Use RCU in ip6_output() in order to use dst_dev_rcu() to prevent possible UAF.
We can remove rcu_read_lock()/rcu_read_unlock() pairs from ip6_finish_output2().
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A use-after-free (UAF) vulnerability in the Linux kernel's IPv6 output path is fixed by converting ip6_output() to use RCU and dst_dev_rcu().
Vulnerability
Overview
CVE-2025-40158 is a use-after-free (UAF) vulnerability in the Linux kernel's IPv6 networking stack. The issue resides in the ip6_output() function, which previously did not properly protect the device (dst->dev) reference with RCU. This could lead to a UAF condition when the device is freed while still being accessed. The fix introduces RCU protection in ip6_output() by using dst_dev_rcu() to safely dereference the device reference, ensuring safe access under RCU read lock [1].
ExploitationThe vulnerability can be triggered during IPv6 packet output processing. An attacker would need to be able to send IPv6 traffic and trigger a device removal or namespace cleanup race condition. No authentication is required if the attacker can send packets to the system, but the race window is narrow. The attack surface is local or from a adjacent network, depending on the system's network configuration [1].
ImpactSuccessful exploitation could allow an attacker to cause a use-after-free, leading to a kernel crash (denial of service) or potentially arbitrary code execution with kernel privileges. The CVSS score is not provided, but UAF in kernel networking bugs are typically rated high or critical [1].
MitigationThe fix has been applied to the
Linux kernel stable tree as commit 0393f85c3241c19ba8550f04a812e7d19f6b3082. Users should update their kernel to a version containing this commit. No workaround is mentioned; the patch is the recommended mitigation [1].
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
20393f85c324111709573cc4eVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2News mentions
0No linked articles in our index yet.