CVE-2025-40248
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-12-04

Last updated on: 2025-12-06

Assigner: kernel.org

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/[email protected]/ [2]: https://lore.kernel.org/netdev/[email protected]/ [3]: https://lore.kernel.org/netdev/[email protected]/
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-12-04
Last Modified
2025-12-06
Generated
2026-05-07
AI Q&A
2025-12-04
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
linux linux_kernel *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability occurs in the Linux kernel's vsock implementation during the connect() operation. If a signal or timeout causes the system to disconnect an already established socket, it leads to several issues: race conditions between canceling packets and sending messages that cause incorrect tracking of unsent bytes, resetting the socket state while it is still in use which breaks assumptions in the socket map and triggers warnings, and state transitions that allow transport changes after a connection is established, potentially causing use-after-free or null pointer dereference errors. The fix is to ignore signals/timeouts on connect() if the socket is already established, avoiding disconnection in that case.


How can this vulnerability impact me? :

This vulnerability can lead to unstable socket behavior, including race conditions and incorrect socket state management. This may cause application crashes, unexpected warnings, or even memory corruption such as use-after-free or null pointer dereferences. Such issues can degrade system reliability and potentially be exploited to cause denial of service or other unintended behaviors in applications relying on vsock connections.


What immediate steps should I take to mitigate this vulnerability?

The vulnerability is resolved by ensuring that during connect(), the socket is not disconnected on signal/timeout if it is already established. Immediate mitigation involves updating the Linux kernel to a version that includes this fix, which prevents the disconnect and related race conditions. Avoid using kernel versions vulnerable to this issue.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart