Junglewise Threat Intelligence

CVE-2025-40248: Linux kernel use-after-free in vsock connect handling

CVE-2025-40248 · Severity: info · CVSS 5.5 · Published 2025-12-04

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability in the Linux kernel's vsock (VM Sockets) component could allow a local user to cause a system crash or instability. The issue occurs when a network connection is interrupted by a signal or timeout at the exact moment it is being established, leading to memory corruption or invalid system states. This could result in a denial of service, impacting the availability of virtualized environments or systems relying on vsock for communication.

Technical details

A vulnerability exists in the vsock_connect() function of the Linux kernel's af_vsock.c. When a connect() call is interrupted by a signal or timeout after the socket has already transitioned to the SS_CONNECTED state, the kernel incorrectly attempts to disconnect the socket. This behavior creates several race conditions: 1) a race with sendmsg() leading to inconsistent bytes_unsent counters; 2) a race with sockmap placement causing state assumption violations; and 3) a transition from SS_CONNECTED to SS_UNCONNECTED that allows transport changes after establishment. These races can result in use-after-free or null-pointer dereference conditions. The fix ensures that signals or timeouts are ignored if the connection is already established.

Affected products

  • Linux Linux kernel All versions prior to 6.13-rc1

Timeline

  • 2025-11-19: other: Patch submitted by Michal Luczaj
  • 2025-12-04: advisory: CVE-2025-40248 published

References

Related threats