CVE-2025-38608: bpf, ktls: Fix data corruption when using bpf_msg_pop_data() in ktls
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf, ktls: Fix data corruption when using bpf_msg_pop_data() in ktls
When sending plaintext data, we initially calculated the corresponding ciphertext length. However, if we later reduced the plaintext data length via socket policy, we failed to recalculate the ciphertext length.
This results in transmitting buffers containing uninitialized data during ciphertext transmission.
This causes uninitialized bytes to be appended after a complete "Application Data" packet, leading to errors on the receiving end when parsing TLS record.
The Linux kernel CVE team has assigned CVE-2025-38608 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.20 with commit d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and fixed in 6.1.148 with commit 16aca8bb4ad0d8a13c8b6da4007f4e52d53035bb Issue introduced in 4.20 with commit d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and fixed in 6.6.102 with commit 0e853c1464bcf61207f8b5c32d2ac5ee495e859d Issue introduced in 4.20 with commit d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and fixed in 6.12.42 with commit ee03766d79de0f61ea29ffb6ab1c7b196ea1b02e Issue introduced in 4.20 with commit d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and fixed in 6.15.10 with commit 90d6ef67440cec2a0aad71a0108c8f216437345c Issue introduced in 4.20 with commit d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and fixed in 6.16.1 with commit 1e480387d4b42776f8957fb148af9d75ce93b96d Issue introduced in 4.20 with commit d3b18ad31f93d0b6bae105c679018a1ba7daa9ca and fixed in 6.17-rc1 with commit 178f6a5c8cb3b6be1602de0964cd440243f493c9
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-38608
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/tls/tls_sw.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/16aca8bb4ad0d8a13c8b6da4007f4e52d53035bb https://git.kernel.org/stable/c/0e853c1464bcf61207f8b5c32d2ac5ee495e859d https://git.kernel.org/stable/c/ee03766d79de0f61ea29ffb6ab1c7b196ea1b02e https://git.kernel.org/stable/c/90d6ef67440cec2a0aad71a0108c8f216437345c https://git.kernel.org/stable/c/1e480387d4b42776f8957fb148af9d75ce93b96d https://git.kernel.org/stable/c/178f6a5c8cb3b6be1602de0964cd440243f493c9