Executive brief
A vulnerability in the Linux kernel's TLS (Transport Layer Security) implementation could allow an attacker to cause system instability or potentially gain unauthorized access to data. The issue occurs when the system fails to properly manage memory during the decryption of secure network traffic. This could lead to a system crash or allow malicious data to be written into memory used by other applications.
Technical details
A vulnerability exists in the Linux kernel TLS implementation (net/tls/tls_sw.c) due to improper handling of memory allocation failures during asynchronous decryption. When 'tls_strp_msg_hold' fails to allocate a clone of the socket buffer (skb), the kernel may proceed with decryption, leading to a use-after-free (UAF) condition or writing decrypted data into userspace memory after the associated 'recv()' call has already returned. This is reachable over the network if TLS offload or async decryption is enabled. The fix ensures the kernel waits for all pending decryption requests if the allocation fails. Patches have been released for various stable kernel branches including 6.1.y, 6.6.y, and 6.12.y.
Affected products
- Linux Linux Kernel 6.0 to 6.1.158, 6.6.114, 6.12.55, 6.17.5
Timeline
- 2025-11-12: advisory: CVE-2025-40176 published by kernel.org
References
- https://git.kernel.org/stable/c/39dec4ea3daf77f684308576baf483b55ca7f160
- https://git.kernel.org/stable/c/4fc109d0ab196bd943b7451276690fb6bb48c2e0
- https://git.kernel.org/stable/c/9f83fd0c179e0f458e824e417f9d5ad53443f685
- https://git.kernel.org/stable/c/b8a6ff84abbcbbc445463de58704686011edc8e1
- https://git.kernel.org/stable/c/c61d4368197d65c4809d9271f3b85325a600586a