{"id":"CVE-2026-143152","state":"PUBLISHED","title":"tcp: do not coalesce segments after FIN","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: do not coalesce segments after FIN\n\nA FIN consumes a sequence number. If another FIN segment is coalesced\ninto an skb that already carries FIN, end_seq advances to account for\nthe additional FIN, but tcp_flags still contains only one FIN bit.\n\nWhen the preceding gap is filled and tcp_ofo_queue() processes the\ncoalesced skb, rcv_nxt advances to the skb's end_seq. When the receive\npath consumes all data in the skb, copied_seq advances by the data\nlength and one sequence number for FIN. If three or more FIN segments\nhave been coalesced into one skb, tcp_inq() can still return a positive\nvalue after the receive queue becomes empty and the SOCK_DONE adjustment\nis applied.\n\nTCP_ZEROCOPY_RECEIVE is another consumer affected by this state.\ntcp_zerocopy_receive() takes its length from tcp_inq() and follows\nskb->next without checking for the end of the receive queue.\n\nSoftware kTLS receive is one consumer affected by this state. When\nstrp->copy_mode is false, tls_strp_msg_consume() calls the TCP helper\ntcp_read_done() to consume the current TLS record. In the reproducer,\ntcp_read_done() consumed the record data and one FIN before freeing the\nreceive skb.\n\nWhen kTLS looked for the next record, tcp_inq() reported at least\nTLS_HEADER_SIZE bytes even though the receive queue was empty.\ntcp_recv_skb() returned NULL, so tls_strp_load_anchor_with_queue() hit\nWARN_ON_ONCE() and returned without updating the anchor.\n\nSince tcp_inq() had reported at least TLS_HEADER_SIZE,\ntls_strp_read_sock() proceeded to tls_strp_check_queue_ok().\nskb_shinfo(strp->anchor)->frag_list still pointed to the freed receive\nskb. tls_strp_check_queue_ok() then read TCP_SKB_CB(first)->seq through\nthe stale pointer, causing a use-after-free.\n\nThe reproducer followed this call path:\n\n  tls_rx_rec_done()\n    tls_strp_msg_consume()\n      tcp_read_done()                       // frees the receive skb\n    tls_strp_check_rcv()\n      tls_strp_read_sock()\n        tls_strp_load_anchor_with_queue()   // returns after WARN_ON_ONCE()\n          tcp_recv_skb() == NULL\n        tls_strp_check_queue_ok()\n          TCP_SKB_CB(first)->seq            // reads the freed receive skb\n\nKASAN reported:\n\n  BUG: KASAN: slab-use-after-free in tls_strp_check_queue_ok.isra.0+0x5f/0x100\n  Read of size 4 at addr ffff888103169ca8 by task ktls-server/71\n  ...\n  Call Trace:\n   <TASK>\n   ...\n   tls_strp_check_queue_ok.isra.0+0x5f/0x100\n   tls_strp_check_rcv+0x2a9/0x400\n   ...\n   tls_sw_recvmsg+0x3ce/0xa10\n   ...\n   sock_recvmsg+0xea/0x100\n   __sys_recvfrom+0x142/0x1f0\n   ...\n   __x64_sys_recvfrom+0x76/0x90\n   do_syscall_64+0xdd/0x4a0\n   entry_SYSCALL_64_after_hwframe+0x77/0x7f\n   ...\n   </TASK>\n  ...\n  Freed by task 71:\n   ...\n   napi_skb_cache_put+0x24/0xf0\n   skb_attempt_defer_free+0x183/0x3b0\n   tcp_read_done+0x2d4/0x340\n   tls_strp_msg_consume+0x45/0x80\n   tls_sw_recvmsg+0x3c4/0xa10\n   ...\n\nIn tcp_try_coalesce(), skip coalescing when the destination skb already\ncarries FIN. tcp_add_backlog() calls skb_try_coalesce() directly instead\nof using this helper, so add the same check there. Since both paths check\nonly the destination skb, a final segment carrying data and FIN can still\nbe coalesced into an skb without FIN when the other coalescing checks pass.","publishedAt":"2026-12-03T09:19:54.572Z","updatedAt":"2026-12-03T09:19:54.572Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e93a0435f809d009919a743fb6e93076faac8aa7","status":"affected","lessThan":"0fad9b99568afaf017a545302abca2b4b36b319b","versionType":"git"},{"version":"e93a0435f809d009919a743fb6e93076faac8aa7","status":"affected","lessThan":"c9484616ef9b00343bb880b1f11100822b877b3e","versionType":"git"},{"version":"e93a0435f809d009919a743fb6e93076faac8aa7","status":"affected","lessThan":"1c46780dec48893b8c25fd5e33a3127e8dc39dd4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_input.c","net/ipv4/tcp_ipv4.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.18","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_input.c","net/ipv4/tcp_ipv4.c"]}],"references":["https://git.kernel.org/stable/c/0fad9b99568afaf017a545302abca2b4b36b319b","https://git.kernel.org/stable/c/c9484616ef9b00343bb880b1f11100822b877b3e","https://git.kernel.org/stable/c/1c46780dec48893b8c25fd5e33a3127e8dc39dd4"],"weaknesses":[],"ingestedAt":"2026-12-03T09:40:06.136Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143152.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143152","state":"PUBLISHED","datePublished":"2026-12-03T09:19:54.572Z","dateUpdated":"2026-12-03T09:19:54.572Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.355Z"},"containers":{"cna":{"title":"tcp: do not coalesce segments after FIN","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: do not coalesce segments after FIN\n\nA FIN consumes a sequence number. If another FIN segment is coalesced\ninto an skb that already carries FIN, end_seq advances to account for\nthe additional FIN, but tcp_flags still contains only one FIN bit.\n\nWhen the preceding gap is filled and tcp_ofo_queue() processes the\ncoalesced skb, rcv_nxt advances to the skb's end_seq. When the receive\npath consumes all data in the skb, copied_seq advances by the data\nlength and one sequence number for FIN. If three or more FIN segments\nhave been coalesced into one skb, tcp_inq() can still return a positive\nvalue after the receive queue becomes empty and the SOCK_DONE adjustment\nis applied.\n\nTCP_ZEROCOPY_RECEIVE is another consumer affected by this state.\ntcp_zerocopy_receive() takes its length from tcp_inq() and follows\nskb->next without checking for the end of the receive queue.\n\nSoftware kTLS receive is one consumer affected by this state. When\nstrp->copy_mode is false, tls_strp_msg_consume() calls the TCP helper\ntcp_read_done() to consume the current TLS record. In the reproducer,\ntcp_read_done() consumed the record data and one FIN before freeing the\nreceive skb.\n\nWhen kTLS looked for the next record, tcp_inq() reported at least\nTLS_HEADER_SIZE bytes even though the receive queue was empty.\ntcp_recv_skb() returned NULL, so tls_strp_load_anchor_with_queue() hit\nWARN_ON_ONCE() and returned without updating the anchor.\n\nSince tcp_inq() had reported at least TLS_HEADER_SIZE,\ntls_strp_read_sock() proceeded to tls_strp_check_queue_ok().\nskb_shinfo(strp->anchor)->frag_list still pointed to the freed receive\nskb. tls_strp_check_queue_ok() then read TCP_SKB_CB(first)->seq through\nthe stale pointer, causing a use-after-free.\n\nThe reproducer followed this call path:\n\n  tls_rx_rec_done()\n    tls_strp_msg_consume()\n      tcp_read_done()                       // frees the receive skb\n    tls_strp_check_rcv()\n      tls_strp_read_sock()\n        tls_strp_load_anchor_with_queue()   // returns after WARN_ON_ONCE()\n          tcp_recv_skb() == NULL\n        tls_strp_check_queue_ok()\n          TCP_SKB_CB(first)->seq            // reads the freed receive skb\n\nKASAN reported:\n\n  BUG: KASAN: slab-use-after-free in tls_strp_check_queue_ok.isra.0+0x5f/0x100\n  Read of size 4 at addr ffff888103169ca8 by task ktls-server/71\n  ...\n  Call Trace:\n   <TASK>\n   ...\n   tls_strp_check_queue_ok.isra.0+0x5f/0x100\n   tls_strp_check_rcv+0x2a9/0x400\n   ...\n   tls_sw_recvmsg+0x3ce/0xa10\n   ...\n   sock_recvmsg+0xea/0x100\n   __sys_recvfrom+0x142/0x1f0\n   ...\n   __x64_sys_recvfrom+0x76/0x90\n   do_syscall_64+0xdd/0x4a0\n   entry_SYSCALL_64_after_hwframe+0x77/0x7f\n   ...\n   </TASK>\n  ...\n  Freed by task 71:\n   ...\n   napi_skb_cache_put+0x24/0xf0\n   skb_attempt_defer_free+0x183/0x3b0\n   tcp_read_done+0x2d4/0x340\n   tls_strp_msg_consume+0x45/0x80\n   tls_sw_recvmsg+0x3c4/0xa10\n   ...\n\nIn tcp_try_coalesce(), skip coalescing when the destination skb already\ncarries FIN. tcp_add_backlog() calls skb_try_coalesce() directly instead\nof using this helper, so add the same check there. Since both paths check\nonly the destination skb, a final segment carrying data and FIN can still\nbe coalesced into an skb without FIN when the other coalescing checks pass."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e93a0435f809d009919a743fb6e93076faac8aa7","status":"affected","lessThan":"0fad9b99568afaf017a545302abca2b4b36b319b","versionType":"git"},{"version":"e93a0435f809d009919a743fb6e93076faac8aa7","status":"affected","lessThan":"c9484616ef9b00343bb880b1f11100822b877b3e","versionType":"git"},{"version":"e93a0435f809d009919a743fb6e93076faac8aa7","status":"affected","lessThan":"1c46780dec48893b8c25fd5e33a3127e8dc39dd4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_input.c","net/ipv4/tcp_ipv4.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.18","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_input.c","net/ipv4/tcp_ipv4.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/0fad9b99568afaf017a545302abca2b4b36b319b"},{"url":"https://git.kernel.org/stable/c/c9484616ef9b00343bb880b1f11100822b877b3e"},{"url":"https://git.kernel.org/stable/c/1c46780dec48893b8c25fd5e33a3127e8dc39dd4"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:19:54.572Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.18","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}