CVE-2026-143359: bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6
In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject non-IPv6 packets in BPFLWTENCAPSEG6
The mode BPFLWTENCAPSEG6 of bpflwtpushencap() pushes an IPv6 header and an SRH, and it replaces the dst. The SRH says that IPv6 follows, and skb->protocol does not change. Thus the mode assumes an IPv6 packet, but an lwtin prog also runs for IPv4 packets. After the prog, bpfinput() calls originput() of the old dst. This IPv4 handler reads the pushed headers as IPv4. It can write after the packet data, and the kernel crashes.
after the push originput() expects --------------------- -------------------- skb->protocol ETHPIP ETHPIP dst rt6info rtable packet | IPv6 | SRH | IPv4 | | IPv4 |
The mode BPFLWTENCAPSEG6INLINE returns -EBADMSG for non-IPv6 packets. Apply this check to both modes. End.BPF does not change, because seg6localinput() drops non-IPv6 packets.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems are exposed when an lwt_in BPF program can apply BPF_LWT_ENCAP_SEG6 to IPv4 packets. The unsafe path occurs because the encapsulation mode assumes an IPv6 packet while the existing destination input handler can remain an IPv4 handler.
What is the impact of sending an IPv4 packet through the affected path?
The IPv4 input handler can interpret the newly pushed IPv6 and SRH headers as IPv4 data and write beyond the packet data. This can crash the kernel.
How can administrators determine whether their configuration is affected?
Review lwt_in BPF programs for use of BPF_LWT_ENCAP_SEG6 and determine whether those programs may process IPv4 traffic. BPF_LWT_ENCAP_SEG6_INLINE already rejects non-IPv6 packets, and End.BPF is described as dropping non-IPv6 packets.