VYPR
Unrated severityNVD Advisory· Published Dec 4, 2025· Updated Apr 15, 2026

CVE-2025-40248

CVE-2025-40248

Description

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

vsock: Ignore signal/timeout on connect() if already established

During connect(), acting on a signal/timeout by disconnecting an already established socket leads to several issues:

1. connect() invoking vsock_transport_cancel_pkt() -> virtio_transport_purge_skbs() may race with sendmsg() invoking virtio_transport_get_credit(). This results in a permanently elevated vvs->bytes_unsent. Which, in turn, confuses the SOCK_LINGER handling.

2. connect() resetting a connected socket's state may race with socket being placed in a sockmap. A disconnected socket remaining in a sockmap breaks sockmap's assumptions. And gives rise to WARNs.

3. connect() transitioning SS_CONNECTED -> SS_UNCONNECTED allows for a transport change/drop after TCP_ESTABLISHED. Which poses a problem for any simultaneous sendmsg() or connect() and may result in a use-after-free/null-ptr-deref.

Do not disconnect socket on signal/timeout. Keep the logic for unconnected sockets: they don't linger, can't be placed in a sockmap, are rejected by sendmsg().

[1]: https://lore.kernel.org/netdev/e07fd95c-9a38-4eea-9638-133e38c2ec9b@rbox.co/ [2]: https://lore.kernel.org/netdev/20250317-vsock-trans-signal-race-v4-0-fc8837f3f1d4@rbox.co/ [3]: https://lore.kernel.org/netdev/60f1b7db-3099-4f6a-875e-af9f6ef194f6@rbox.co/

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A Linux kernel vsock bug allows signal/timeout during connect() to disconnect an already-established socket, leading to use-after-free, and sockmap corruption.

Vulnerability

In the Linux kernel's vsock implementation, the connect() system call could be interrupted by a signal or timeout even after the socket had already transitioned to the SS_CONNECTED state. When this happened, the kernel would incorrectly tear down the established connection, leading to a race condition with concurrent sendmsg() operations and potential corruption of internal state.

Exploitation

An attacker who can trigger a signal or timeout on a vsock socket during the connect() call—for example, by sending a signal to the process or by exploiting a network timeout—can cause the kernel to invoke vsock_transport_cancel_pkt(), which may race with virtio_transport_get_credit() called from sendmsg(). This race can leave the bytes_unsent counter permanently elevated, confusing the SOCK_LINGER handling. Additionally, resetting a connected socket's state can race with the socket being placed in a sockmap, leading to a disconnected socket remaining in the map and triggering kernel warnings (WARNs).

Impact

A successful exploit can result in a use-after-free or NULL-pointer dereference, as the socket transitions from SS_CONNECTED to SS_UNCONNECTED after the connection was already established, allowing a transport change or drop after TCP_ESTABLISHED. This can crash the system or potentially allow an attacker to escalate privileges. The vulnerability.

Mitigation

The fix, applied in multiple stable kernel commits [1][2][3][4], ensures that connect() does not disconnect an already-established socket on signal or timeout. The logic for unconnected sockets remains unchanged, as they cannot be placed in a sockmap and are rejected by sendmsg(). Users should update to a patched kernel version.

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

2

Patches

8

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

8

News mentions

0

No linked articles in our index yet.