CVE-2026-143360: bpf: Don't let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS
In the Linux kernel, the following vulnerability has been resolved:
bpf: Don't let bpfskbadjustroom() raise gsosize to GSOBYFRAGS
When bpfskbadjustroom() shrinks a TCP GSO skb, it adds the number of removed bytes to gsosize. gsosize has 16 bits, and nothing checks the sum. Thus gsosize can wrap to 0 or to a small size, or it can be GSOBYFRAGS. GSOBYFRAGS is not a size. It tells skbsegment() to read the length of each segment from the fraglist. If the TCP GSO skb has no fraglist, skbsegment() dereferences a NULL pointer.
Return -ENOTSUPP and do not change the skb if the sum is GSOBYFRAGS or larger. With BPFFADJROOMFIXEDGSO the helper does not change gsosize, so it shrinks the skb as before.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Exposure requires a BPF program that calls bpf_skb_adjust_room() to shrink TCP GSO packets without BPF_F_ADJ_ROOM_FIXED_GSO. The problematic path is reached when the removed-byte count causes the resulting gso_size to reach GSO_BY_FRAGS or a larger value.
What can happen if the affected path is reached?
The gso_size value can wrap to zero or a small value, or become GSO_BY_FRAGS. If it becomes GSO_BY_FRAGS and the TCP GSO packet has no frag_list, skb_segment() can dereference a NULL pointer.
What is a workaround if the kernel update cannot be applied immediately?
Where compatible with the BPF program's intended behavior, use BPF_F_ADJ_ROOM_FIXED_GSO when calling bpf_skb_adjust_room(). With that flag, the helper does not modify gso_size while shrinking the packet.
How can an operator assess whether their BPF programs use the vulnerable behavior?
Review BPF programs that invoke bpf_skb_adjust_room() on TCP GSO traffic and identify calls that shrink packet room without BPF_F_ADJ_ROOM_FIXED_GSO. Pay particular attention to paths that can remove enough bytes to raise gso_size to GSO_BY_FRAGS or beyond.