CVE-2026-143347: tcp: do not let tcp_collapse() drive sk_forward_alloc negative
In the Linux kernel, the following vulnerability has been resolved:
tcp: do not let tcpcollapse() drive skforwardalloc negative
tcpcollapse() charges each newly allocated skb with skbsetownerr() before the skbs it replaces are freed, without scheduling memory first.
Since skmemuncharge() reclaims eagerly, sk->skforwardalloc has no cushion and can become negative. This can be durable when the collapsed skbs had a high payload/truesize ratio or were partially read, because the new skbs can have a bigger total truesize than the old ones.
A negative skforwardalloc then confuses tcpwmemschedule(), which can return a negative length to tcpsendmsglocked(), triggering a WARNONONCE(bytes > INTMAX) in checkcopysize().
Call skforcedmemschedule() before charging nskb.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7 - Compensating control
In tcp_collapse(), call sk_forced_mem_schedule() before charging nskb.
Event History
Frequently Asked Questions
What conditions make the incorrect memory accounting more likely to persist?
It can persist when collapsed socket buffers have a high payload-to-truesize ratio or have been partially read, because replacement buffers may have a larger total truesize than the buffers they replace.
What observable symptom can indicate that this condition has been reached?
A negative sk_forward_alloc can cause tcp_wmem_schedule() to return a negative length to tcp_sendmsg_locked(), triggering the WARN_ON_ONCE(bytes > INT_MAX) check in check_copy_size().
What is the documented fix approach?
The resolved change calls sk_forced_mem_schedule() before charging the newly allocated replacement socket buffer, preventing tcp_collapse() from driving sk_forward_alloc negative.