CVE-2026-64045: ovpn: tcp - use cached peer pointer in ovpn_tcp_close()
In the Linux kernel, the following vulnerability has been resolved:
ovpn: tcp - use cached peer pointer in ovpntcpclose()
ovpntcpclose() loads the ovpnsocket via rcudereferenceskuserdata() under rcureadlock(), takes a reference on sock->peer, caches the peer pointer in a local, and drops the read lock. It then passes sock->peer (rather than the cached local) to ovpnpeerdel(), re-dereferencing the ovpnsocket after the RCU read section has ended.
Unlike ovpntcpsendmsg(), which uses the same "load under RCU, use after unlock" pattern but is protected by locksock() held across the function, ovpntcpclose() runs without the socket lock: inetrelease() invokes skprot->close() without taking locksock first.
ovpnsocketrelease() can therefore complete its krefput -> detach -> synchronizercu -> kfree(sock) sequence concurrently, in the window after ovpntcpclose() drops rcureadlock() but before it dereferences sock->peer. The synchronizercu() in ovpnsocketrelease() protects readers that use the dereferenced pointer inside the RCU read section, not those that escape the pointer to a local and use it afterwards.
A reproducer follows the pattern of commit 94560267d6c4 ("ovpn: tcp - don't deref NULL sksocket member after tcpclose()"): trigger a peer removal (keepalive expiration or netlink OVPNCMDDELPEER) at the same moment userspace closes the TCP fd. That commit fixed the detach-side of the same race window; this one fixes the close-side at a different victim.
Tighten the entry block to read sock->peer exactly once into the cached peer local, and route all subsequent uses (the hold check, the ovpnpeerdel() call, and the prot->close() invocation) through that local. sock->peer is only ever written once in ovpnsocketnew() under locksock(), before rcuassignskuserdata() publishes the ovpnsocket, and is never reassigned afterwards - but the previous multi-read pattern made that invariant implicit rather than explicit. The same multi-read shape exists in ovpntcprecvmsg(), ovpntcpsendmsg(), ovpntcpdataready() and ovpntcpwritespace(); those will be cleaned up via a dedicated helper in a follow-up net-next series.
Affected Software
Remediation
Event History
Frequently Asked Questions
What access does an attacker need to exploit this issue?
The CVSS vector identifies this as locally exploitable with no privileges or user interaction required. The available data does not describe a remote attack path.
Which systems are exposed?
Systems running the affected Linux kernel OpenVPN-related TCP code are relevant. The issue involves concurrent TCP close and OpenVPN socket release activity; no affected kernel version range is provided.
What is the impact if exploitation succeeds?
The severity data rates the issue High at CVSS 8.4, with high confidentiality, integrity, and availability impact. The flaw can result from dereferencing an OpenVPN socket after its RCU protection has ended and the socket has been freed.
What remediation is available?
A patch is available. Apply the relevant Linux kernel stable fix referenced in the advisory.