{"id":"CVE-2025-38471","state":"PUBLISHED","title":"tls: always refresh the queue when reading sock","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntls: always refresh the queue when reading sock\n\nAfter recent changes in net-next TCP compacts skbs much more\naggressively. This unearthed a bug in TLS where we may try\nto operate on an old skb when checking if all skbs in the\nqueue have matching decrypt state and geometry.\n\n    BUG: KASAN: slab-use-after-free in tls_strp_check_rcv+0x898/0x9a0 [tls]\n    (net/tls/tls_strp.c:436 net/tls/tls_strp.c:530 net/tls/tls_strp.c:544)\n    Read of size 4 at addr ffff888013085750 by task tls/13529\n\n    CPU: 2 UID: 0 PID: 13529 Comm: tls Not tainted 6.16.0-rc5-virtme\n    Call Trace:\n     kasan_report+0xca/0x100\n     tls_strp_check_rcv+0x898/0x9a0 [tls]\n     tls_rx_rec_wait+0x2c9/0x8d0 [tls]\n     tls_sw_recvmsg+0x40f/0x1aa0 [tls]\n     inet_recvmsg+0x1c3/0x1f0\n\nAlways reload the queue, fast path is to have the record in the queue\nwhen we wake, anyway (IOW the path going down \"if !strp->stm.full_len\").","publishedAt":"2025-07-28T11:21:32.927Z","updatedAt":"2026-10-15T01:07:24.522Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"730fed2ff5e259495712518e18d9f521f61972bb","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"1f3a429c21e0e43e8b8c55d30701e91411a4df02","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"cdb767915fc9a15d88d19d52a1455f1dc3e5ddc8","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"c76f6f437c46b2390888e0e1dc7aafafa9f4e0c6","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"4ab26bce3969f8fd925fe6f6f551e4d1a508c68b","versionType":"git"},{"version":"2277d7cbdf47531b2c3cd01ba15255fa955aab35","status":"affected","versionType":"git"},{"version":"6.0.6","status":"affected","lessThan":"6.1","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/tls/tls_strp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.1","versionType":"semver"},{"version":"6.1.147","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.100","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.40","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.8","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/tls/tls_strp.c"]}],"references":["https://git.kernel.org/stable/c/730fed2ff5e259495712518e18d9f521f61972bb","https://git.kernel.org/stable/c/1f3a429c21e0e43e8b8c55d30701e91411a4df02","https://git.kernel.org/stable/c/cdb767915fc9a15d88d19d52a1455f1dc3e5ddc8","https://git.kernel.org/stable/c/c76f6f437c46b2390888e0e1dc7aafafa9f4e0c6","https://git.kernel.org/stable/c/4ab26bce3969f8fd925fe6f6f551e4d1a508c68b","https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","https://cert-portal.siemens.com/productcert/html/ssa-082556.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/38xxx/CVE-2025-38471.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38471","state":"PUBLISHED","datePublished":"2025-07-28T11:21:32.927Z","dateUpdated":"2026-10-15T01:07:24.522Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:24.021Z"},"containers":{"cna":{"title":"tls: always refresh the queue when reading sock","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntls: always refresh the queue when reading sock\n\nAfter recent changes in net-next TCP compacts skbs much more\naggressively. This unearthed a bug in TLS where we may try\nto operate on an old skb when checking if all skbs in the\nqueue have matching decrypt state and geometry.\n\n    BUG: KASAN: slab-use-after-free in tls_strp_check_rcv+0x898/0x9a0 [tls]\n    (net/tls/tls_strp.c:436 net/tls/tls_strp.c:530 net/tls/tls_strp.c:544)\n    Read of size 4 at addr ffff888013085750 by task tls/13529\n\n    CPU: 2 UID: 0 PID: 13529 Comm: tls Not tainted 6.16.0-rc5-virtme\n    Call Trace:\n     kasan_report+0xca/0x100\n     tls_strp_check_rcv+0x898/0x9a0 [tls]\n     tls_rx_rec_wait+0x2c9/0x8d0 [tls]\n     tls_sw_recvmsg+0x40f/0x1aa0 [tls]\n     inet_recvmsg+0x1c3/0x1f0\n\nAlways reload the queue, fast path is to have the record in the queue\nwhen we wake, anyway (IOW the path going down \"if !strp->stm.full_len\")."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"730fed2ff5e259495712518e18d9f521f61972bb","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"1f3a429c21e0e43e8b8c55d30701e91411a4df02","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"cdb767915fc9a15d88d19d52a1455f1dc3e5ddc8","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"c76f6f437c46b2390888e0e1dc7aafafa9f4e0c6","versionType":"git"},{"version":"0d87bbd39d7fd1135ab9eca672d760470f6508e8","status":"affected","lessThan":"4ab26bce3969f8fd925fe6f6f551e4d1a508c68b","versionType":"git"},{"version":"2277d7cbdf47531b2c3cd01ba15255fa955aab35","status":"affected","versionType":"git"},{"version":"6.0.6","status":"affected","lessThan":"6.1","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/tls/tls_strp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.1","versionType":"semver"},{"version":"6.1.147","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.100","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.40","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.8","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/tls/tls_strp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/730fed2ff5e259495712518e18d9f521f61972bb"},{"url":"https://git.kernel.org/stable/c/1f3a429c21e0e43e8b8c55d30701e91411a4df02"},{"url":"https://git.kernel.org/stable/c/cdb767915fc9a15d88d19d52a1455f1dc3e5ddc8"},{"url":"https://git.kernel.org/stable/c/c76f6f437c46b2390888e0e1dc7aafafa9f4e0c6"},{"url":"https://git.kernel.org/stable/c/4ab26bce3969f8fd925fe6f6f551e4d1a508c68b"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - The vulnerable code is the kTLS receive strparser, driven directly from the TCP `sk_data_ready` softirq hook and from `recvmsg()` on data supplied by the remote TLS peer. A remote attacker triggers it purely by choosing TLS record framing and TCP segment sizes/timing on an ordinary connection to a kTLS-enabled service.\nAC:L - The attacker controls every side of the condition — the record header that sets `stm.full_len`, the many small/large segments that push `sk_rmem_alloc` past `sk_rcvbuf` to force `tcp_collapse()` to free the anchored skb, and the final segment that makes `inq >= full_len` — and can retry indefinitely across parallel connections. It was hit by the plain in-tree `tls` selftest, not an exotic race.\nPR:N - The attacker is the remote peer of a TLS connection and needs no account or privilege on the target; kTLS servers (nginx/HAProxy with kTLS offload, TLS-terminating proxies) accept connections from anonymous clients and enable `TLS_RX` right after the handshake.\nUI:N - The victim application merely receives data on an already-established kTLS socket; the strparser runs from softirq on packet arrival with no local user action required.\nS:U - The corruption is confined to kernel skb/slab memory of the affected host, with no crossing of a VM, IOMMU, or sandbox security authority.\nC:H - This is a slab use-after-free read: freed skb metadata is read, and the attacker-influenced `skb->next` chain lets the loop walk into reallocated memory, giving an arbitrary-address read oracle via the true/false result; freed pages are further fed into the AEAD scatterlist by `skb_to_sgvec()`.\nI:H - Use-after-free with heap grooming yields write primitives — `tls_strp_msg_hold()` performs `skb_clone()` on the freed skbs, writing refcounts into reallocated objects, and the stale `frag_list` drives crypto operations over freed memory, which is exploitable for control-flow hijacking.\nA:H - KASAN confirms a slab-use-after-free, and the unbounded `skb = skb->next` walk over freed memory readily faults on a wild pointer, producing a kernel oops/panic that a remote attacker can trigger repeatedly."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:02:10.110Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.1.147"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.6.100"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.12.40"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.15.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0.6"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T17:38:36.234Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T01:07:24.522Z"},"x_adpType":"supplier"}]}}}