CVE-2026-139319: bpf: Don't let bpf_skb_adjust_room() use up the MSS
In the Linux kernel, the following vulnerability has been resolved:
bpf: Don't let bpfskbadjustroom() use up the MSS
When bpfskbadjustroom() grows a TCP GSO packet without BPFFADJROOMFIXEDGSO, gsosize is lowered by the number of bytes added. Nothing looks at how large it is.
gsosize is the size of the segments the peer has sent if the packet comes out of GRO, and what the sender has written into the virtio header if it comes from a tun device or a packet socket. If it equals lendiff the result is 0, and a packet of up to 64 KB is no GSO packet any more. If it is smaller, the 16 bit value wraps around.
One less than lendiff gives GSOBYFRAGS. skbsegment() then takes the length of each segment from the fraglist. A packet with more than 64 KB of payload gets that far, and one from a tun device has no fraglist:
BUG: KASAN: null-ptr-deref in skbsegment+0xcf1/0x1a90 BUG: kernel NULL pointer dereference, address: 0000000000000070 tcpgsosegment+0x1be/0x9f0 inetgsosegment+0x288/0x740 inetgsosegment+0x288/0x740 skbmacgsosegment+0x179/0x2e0
What is left must not be less than TCPMINGSOSIZE either. The stack relies on that for the number of segments to fit into gsosegs, see commit c27c449d455a ("virtio-net: Ensure that TCP packets don't overflow gsosegs").
Refuse to grow a packet that would end up with less, with the error that other packets which cannot be adjusted get.
Affected Software
Event History
Frequently Asked Questions
What traffic and BPF behavior are needed to trigger this issue?
A TCP GSO packet must be enlarged by bpf_skb_adjust_room() without BPF_F_ADJ_ROOM_FIXED_GSO. The issue occurs when the number of added bytes is at least the packet's current gso_size, causing gso_size to become zero or wrap.
Which packet sources are specifically relevant?
The affected gso_size can originate from GRO, from the virtio header of a tun device, or from a packet socket. A packet from a tun device is specifically described as having no frag_list, which can lead to a null-pointer dereference during segmentation.
What evidence would indicate that a system has encountered the problem?
The described failure produces a KASAN null-pointer-dereference report in skb_segment(), with tcp_gso_segment(), inet_gso_segment(), and skb_mac_gso_segment() in the call trace. The faulting null address shown is 0x70.
What behavior should be avoided until the resolution is applied?
Avoid BPF programs that grow TCP GSO packets with bpf_skb_adjust_room() without BPF_F_ADJ_ROOM_FIXED_GSO when the growth could consume or exceed gso_size. The remaining gso_size must also not fall below TCP_MIN_GSO_SIZE.