vsock: Use-after-free in Linux kernel vsock (CVE-2025-21756) (CVE-2025-21756) #shorts
Summary
CVE-2025-21756 is a high-severity memory corruption flaw in the Linux kernel vsock subsystem. A use-after-free condition during socket bind and transport release operations could be triggered by a local attacker, leading to potential denial of service or privilege escalation. The issue was publicly disclosed in February 2025 and resolved in kernel 6.14 and later.
Product details
Affected are Linux kernel mainline versions beginning with commit c0cfa2d8a (in 5.5) up to versions before the fixes backported into the 5.10, 5.15, 6.1, 6.6, 6.12 and 6.13 stable trees. Distributions shipping kernels earlier than 6.14 (or patched stable branches) are vulnerable. The fix is included in official 6.14 releases and recent stable updates.
Vulnerability type summary
This is a use-after-free vulnerability caused by improper management of socket refcounts in the vsock implementation. The kernel fails to preserve binding state during a transport reassignment, leading to premature object release, refcount underflow and potential memory corruption under KASAN.
Details of the vulnerability
When a vsock is created it is placed on an unbound list and its reference count is incremented. During a transport release, the code erroneously calls vsock_remove_bound without checking if the socket had already been moved to the bound list. A subsequent vsock_bind invocation then calls __vsock_remove_bound again, freeing the socket object. A following list_del_init is a no-op, so the refcount hits zero and the object is reused while still referenced. Under KASAN this is flagged as slab use-after-free, but in production builds it could corrupt memory, crash the system, or be leveraged for local privilege escalation.
Conclusion
Administrators should upgrade to Linux kernel 6.14 or apply the backported patches in their stable branch. Containers or workloads relying on vsock (e.g., virtualization, VM guest/host communication) should be prioritized. Regularly tracking distribution security advisories and maintaining patched kernels will mitigate this and similar memory-safety flaws.
Watch the full video on YouTube: CVE-2025-21756
Remediation and exploitation details
This chain involves the following actors
This following systems are involved
Attack entry point
Remediation actions
Exploitation actions
Related Content
NOTE: The following related content has not been vetted and may be unsafe.
- https://git.kernel.org/stable/c/e7754d564579a5db9c5c9f74228df5d6dd6f1173
- https://git.kernel.org/stable/c/e48fcb403c2d0e574c19683f09399ab4cf67809c
- https://git.kernel.org/stable/c/42b33381e5e1f2b967dc4fb4221ddb9aaf10d197
- https://git.kernel.org/stable/c/3f43540166128951cc1be7ab1ce6b7f05c670d8b
- https://git.kernel.org/stable/c/645ce25aa0e67895b11d89f27bb86c9d444c40f8
- https://git.kernel.org/stable/c/b1afd40321f1c243cffbcf40ea7ca41aca87fa5e
- https://git.kernel.org/stable/c/fcdd2242c0231032fc84e1404315c245ae56322a
- [2025-05-01] Reddit post about CVE-2025-21756 vulnerability in Vsock.
- [2025-04-30] Discussion on Linux Kernel exploitation vulnerability CVE-2025-21756.
- [2025-04-30] An article discussing Linux Kernel exploitation and CVE-2025-21756.