CVE-2026-68342: ovpn: avoid putting unrelated P2P peer on socket release
In the Linux kernel, the following vulnerability has been resolved:
ovpn: avoid putting unrelated P2P peer on socket release
ovpnpeerreleasep2p() is called when an OVPN UDP socket is being destroyed. It checks the currently published P2P peer and releases it only if that peer still uses the socket being destroyed.
A peer replacement can publish a new peer before the old UDP socket is destroyed. When the old socket destruction path runs afterwards, ovpnpeerreleasep2p() observes the new peer through ovpn->peer. Since the new peer uses a different socket, the function takes the socket mismatch branch.
That branch still calls ovpnpeerput(peer). At this point, however, peer is the currently published replacement peer, not the peer associated with the socket being destroyed. Dropping its reference can free it while ovpn->peer still points to it, leading to later use-after-free accesses from the peer and socket cleanup paths.
KASAN reports this as a slab-use-after-free on the kmalloc-1k ovpnpeer object. In the reproducer, the object is allocated from ovpnpeernew() via ovpnnlpeernewdoit(), and freed through ovpnpeerreleasercu() from RCU callback processing. Observed access sites include ovpnpeerremove(), ovpnsocketrelease(), ovpnnlpeerdelnotify(), and unlockovpn().
Fix this by returning from the socket mismatch branch without putting the peer.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-68342?
CVE-2026-68342 is classified with medium severity due to potential impacts on connection stability.
How do I fix CVE-2026-68342?
To fix CVE-2026-68342, update your Linux kernel to the latest version where this vulnerability has been resolved.
What are the potential impacts of CVE-2026-68342?
CVE-2026-68342 can result in unexpected behavior during socket releases, potentially leading to information leakage or denial of service.
What systems are affected by CVE-2026-68342?
CVE-2026-68342 affects environments utilizing OpenVPN with the Linux kernel where related P2P peer functionality is deployed.
Is CVE-2026-68342 exploit-related?
While CVE-2026-68342 is not directly associated with exploitation, it could allow an attacker to destabilize connections under certain conditions.