# CVE-2026-45918: ovpn: tcp - don't deref NULL sk_socket member after tcp_close()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.16%, higher than 5% of CVEs (2026-12-01)
- Published: 2026-05-27T12:17:34.500Z
- Modified: 2026-06-24T17:22:46.393Z
- Weaknesses: CWE-476
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

ovpn: tcp - don't deref NULL sk_socket member after tcp_close()

When deleting a peer in case of keepalive expiration, the peer is
removed from the OpenVPN hashtable and is temporary inserted in a
"release list" for further processing.

This happens in:
ovpn_peer_keepalive_work()
  unlock_ovpn(release_list)

This processing includes detaching from the socket being used to
talk to this peer, by restoring its original proto and socket
ops/callbacks.

In case of TCP it may happen that, while the peer is sitting in
the release list, userspace decides to close the socket.
This will result in a concurrent execution of:

tcp_close(sk)
  __tcp_close(sk)
    sock_orphan(sk)
      sk_set_socket(sk, NULL)

The last function call will set sk->sk_socket to NULL.

When the releasing routine is resumed, ovpn_tcp_socket_detach()
will attempt to dereference sk->sk_socket to restore its original
ops member. This operation will crash due to sk->sk_socket being NULL.

Fix this race condition by testing-and-accessing
sk->sk_socket atomically under sk->sk_callback_lock.

(As written by CVE List.)

## Affected

- Linux Linux: from 11851cbd60ea1e5abbd97619d69845ead99303d6 before f998b2c4bec487063a586695159f9a1856e81c56; from 11851cbd60ea1e5abbd97619d69845ead99303d6 before b9142cf4e066c825ec68752a7dcaceda700bbe26; from 11851cbd60ea1e5abbd97619d69845ead99303d6 before 94560267d6c41b1ff3fafbab726e3f8a55a6af34; 6.16 (not affected: before 6.16; from 6.18.14 up to 6.18.*; from 6.19.4 up to 6.19.*; from 7.0 up to *)
- linux linux_kernel: from 6.16 before 6.18.14; from 6.19 before 6.19.4

## References

- <https://git.kernel.org/stable/c/f998b2c4bec487063a586695159f9a1856e81c56> (patch)
- <https://git.kernel.org/stable/c/b9142cf4e066c825ec68752a7dcaceda700bbe26> (patch)
- <https://git.kernel.org/stable/c/94560267d6c41b1ff3fafbab726e3f8a55a6af34> (patch)

## Sources

- CVE List: [CVE-2026-45918](https://www.cve.org/CVERecord?id=CVE-2026-45918), CVE Terms of Use, modified 2026-05-27
- NVD: [CVE-2026-45918](https://nvd.nist.gov/vuln/detail/CVE-2026-45918), Public domain, modified 2026-06-24

---

Page: https://cve.day/CVE-2026-45918 · Whole record: https://cve.day/CVE-2026-45918.json · Rebuilt by cve.day 2026-11-25T22:59:22.504Z
