{"id":"CVE-2026-143240","state":"PUBLISHED","title":"tcp: rate limit receive queue collapsing","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: rate limit receive queue collapsing\n\nWhen a socket is over its receive buffer limit and its sk_rcvbuf can\nnot grow, every incoming segment that needs memory goes through\ntcp_prune_queue(), which runs tcp_collapse_ofo_queue() and tcp_collapse()\non the receive queue. Both walk their whole queue, even when there is\nnothing left to collapse.\n\nA peer can trigger this walk per packet, without refilling memory:\n\n1) The segment lands last in the out-of-order queue. Since commit\n   b0e01253a764 (\"tcp: refine tcp_prune_ofo_queue() logic\"),\n   tcp_prune_ofo_queue() drops nothing, the segment is dropped and\n   the queues are unchanged. The peer can send it again forever.\n\n2) The segment lands second to last: one skb is pruned, and one small\n   segment fills that space again.\n\n3) The out-of-order queue is empty and the receive queue alone is over\n   the limit (application not reading). Collapsing frees nothing,\n   the out-of-order segment is dropped, and the window is not closed.\n\n4) Collapsing frees just one skb, enough to queue the segment. The next\n   segment is over the limit again.\n\nOnly allow a collapse if at least 1/8 of sk_rcvbuf of new memory was\nqueued in the receive queues since the previous collapse. This restores\nthe \"12.5 % of the queue capacity\" amortization of the 2018 SegmentSmack\nfixes (CVE-2018-5390), using the same unit as the sk_rcvbuf limit, so\nthat peers sending small (bloated) segments are not penalized.\n\nThe credit is the net growth of sk_rmem_alloc in tcp_queue_rcv() and\ntcp_data_queue_ofo(), so that:\n\n- Coalescing a segment into the tailroom of the previous skb charges no\n  memory, and earns no credit.\n- An out-of-order segment replacing or covering queued skbs only earns\n  the memory it adds.\n- Duplicates earn nothing.\n- Data moved from the out-of-order queue to the receive queue\n  (tcp_ofo_queue()) is not credited twice.\n\nIn-order data is credited too, so that a receive queue filled by\nbloated in-order segments can still be collapsed when a hole appears.\n\nIn-order segments are rate limited as well: a peer could otherwise send\nsmall in-order segments that each trigger a collapse freeing a single\nskb, enough to queue the segment, while the out-of-order queue holds\nmany skbs that can not be collapsed.\n\nThe credit is tracked in a new u32 tp->rcv_collapse_credit, placed in a\nhole of the tcp_sock_write_rx group: no other field moves, and tcp_sock\nsize is unchanged. tcp_queue_rcv() now samples sk_rmem_alloc, and\nwrites the credit until it saturates at sk_rcvbuf, so that the fast path\nstops writing it after a full buffer of new memory. Saturating at the\ngoal would not work: sk_rcvbuf, and the goal with it, can grow later\n(for instance in tcp_clamp_window(), just before the goal is checked),\nand a socket over its limit can not earn more credit until the\napplication reads.\n\nWhen collapsing is not allowed, tcp_prune_queue() goes directly to\ntcp_prune_ofo_queue(), which is cheap in the cases above.\n\nA regular flow can see a difference when it goes over its limit before\n1/8 of sk_rcvbuf of new memory was queued since the previous collapse:\nout-of-order skbs can be pruned (even for an in-order segment filling a\nhole), and an in-order segment that still does not fit is dropped,\nwith a zero window advertised, where a collapse might have made room.","publishedAt":"2026-12-03T09:20:53.064Z","updatedAt":"2026-12-03T09:20:53.064Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"b0e01253a764faab9ecf56c0759e6b06470eb9ff","status":"affected","lessThan":"56874f7cc8f1157a35ba5376125a4fc8874a1eb0","versionType":"git"},{"version":"b0e01253a764faab9ecf56c0759e6b06470eb9ff","status":"affected","lessThan":"b286ee1cfb2d6a0cb4b9564d15508ce33d8a0506","versionType":"git"},{"version":"b0e01253a764faab9ecf56c0759e6b06470eb9ff","status":"affected","lessThan":"c2213d9b61c1d6e99645a636630ee767c7542f78","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/networking/net_cachelines/tcp_sock.rst","include/linux/tcp.h","net/ipv4/tcp.c","net/ipv4/tcp_input.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.2","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":["Documentation/networking/net_cachelines/tcp_sock.rst","include/linux/tcp.h","net/ipv4/tcp.c","net/ipv4/tcp_input.c"]}],"references":["https://git.kernel.org/stable/c/56874f7cc8f1157a35ba5376125a4fc8874a1eb0","https://git.kernel.org/stable/c/b286ee1cfb2d6a0cb4b9564d15508ce33d8a0506","https://git.kernel.org/stable/c/c2213d9b61c1d6e99645a636630ee767c7542f78"],"weaknesses":[],"ingestedAt":"2026-12-03T09:42:04.348Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143240.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143240","state":"PUBLISHED","datePublished":"2026-12-03T09:20:53.064Z","dateUpdated":"2026-12-03T09:20:53.064Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.361Z"},"containers":{"cna":{"title":"tcp: rate limit receive queue collapsing","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: rate limit receive queue collapsing\n\nWhen a socket is over its receive buffer limit and its sk_rcvbuf can\nnot grow, every incoming segment that needs memory goes through\ntcp_prune_queue(), which runs tcp_collapse_ofo_queue() and tcp_collapse()\non the receive queue. Both walk their whole queue, even when there is\nnothing left to collapse.\n\nA peer can trigger this walk per packet, without refilling memory:\n\n1) The segment lands last in the out-of-order queue. Since commit\n   b0e01253a764 (\"tcp: refine tcp_prune_ofo_queue() logic\"),\n   tcp_prune_ofo_queue() drops nothing, the segment is dropped and\n   the queues are unchanged. The peer can send it again forever.\n\n2) The segment lands second to last: one skb is pruned, and one small\n   segment fills that space again.\n\n3) The out-of-order queue is empty and the receive queue alone is over\n   the limit (application not reading). Collapsing frees nothing,\n   the out-of-order segment is dropped, and the window is not closed.\n\n4) Collapsing frees just one skb, enough to queue the segment. The next\n   segment is over the limit again.\n\nOnly allow a collapse if at least 1/8 of sk_rcvbuf of new memory was\nqueued in the receive queues since the previous collapse. This restores\nthe \"12.5 % of the queue capacity\" amortization of the 2018 SegmentSmack\nfixes (CVE-2018-5390), using the same unit as the sk_rcvbuf limit, so\nthat peers sending small (bloated) segments are not penalized.\n\nThe credit is the net growth of sk_rmem_alloc in tcp_queue_rcv() and\ntcp_data_queue_ofo(), so that:\n\n- Coalescing a segment into the tailroom of the previous skb charges no\n  memory, and earns no credit.\n- An out-of-order segment replacing or covering queued skbs only earns\n  the memory it adds.\n- Duplicates earn nothing.\n- Data moved from the out-of-order queue to the receive queue\n  (tcp_ofo_queue()) is not credited twice.\n\nIn-order data is credited too, so that a receive queue filled by\nbloated in-order segments can still be collapsed when a hole appears.\n\nIn-order segments are rate limited as well: a peer could otherwise send\nsmall in-order segments that each trigger a collapse freeing a single\nskb, enough to queue the segment, while the out-of-order queue holds\nmany skbs that can not be collapsed.\n\nThe credit is tracked in a new u32 tp->rcv_collapse_credit, placed in a\nhole of the tcp_sock_write_rx group: no other field moves, and tcp_sock\nsize is unchanged. tcp_queue_rcv() now samples sk_rmem_alloc, and\nwrites the credit until it saturates at sk_rcvbuf, so that the fast path\nstops writing it after a full buffer of new memory. Saturating at the\ngoal would not work: sk_rcvbuf, and the goal with it, can grow later\n(for instance in tcp_clamp_window(), just before the goal is checked),\nand a socket over its limit can not earn more credit until the\napplication reads.\n\nWhen collapsing is not allowed, tcp_prune_queue() goes directly to\ntcp_prune_ofo_queue(), which is cheap in the cases above.\n\nA regular flow can see a difference when it goes over its limit before\n1/8 of sk_rcvbuf of new memory was queued since the previous collapse:\nout-of-order skbs can be pruned (even for an in-order segment filling a\nhole), and an in-order segment that still does not fit is dropped,\nwith a zero window advertised, where a collapse might have made room."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"b0e01253a764faab9ecf56c0759e6b06470eb9ff","status":"affected","lessThan":"56874f7cc8f1157a35ba5376125a4fc8874a1eb0","versionType":"git"},{"version":"b0e01253a764faab9ecf56c0759e6b06470eb9ff","status":"affected","lessThan":"b286ee1cfb2d6a0cb4b9564d15508ce33d8a0506","versionType":"git"},{"version":"b0e01253a764faab9ecf56c0759e6b06470eb9ff","status":"affected","lessThan":"c2213d9b61c1d6e99645a636630ee767c7542f78","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["Documentation/networking/net_cachelines/tcp_sock.rst","include/linux/tcp.h","net/ipv4/tcp.c","net/ipv4/tcp_input.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.2","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":["Documentation/networking/net_cachelines/tcp_sock.rst","include/linux/tcp.h","net/ipv4/tcp.c","net/ipv4/tcp_input.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/56874f7cc8f1157a35ba5376125a4fc8874a1eb0"},{"url":"https://git.kernel.org/stable/c/b286ee1cfb2d6a0cb4b9564d15508ce33d8a0506"},{"url":"https://git.kernel.org/stable/c/c2213d9b61c1d6e99645a636630ee767c7542f78"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:20:53.064Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}