CVE-2026-143353: bpf: Don't let lwt_in progs call into IPv6 when it is disabled
In the Linux kernel, the following vulnerability has been resolved:
bpf: Don't let lwtin progs call into IPv6 when it is disabled
With ipv6.disable=1, inet6init() returns before it registers any pernet subsystem. Thus net->ipv6.devconfall and net->ipv6.seg6data stay NULL. ISENABLED(CONFIGIPV6) only says that the code is built in. bpflwtinputreroute() and bpfpushseg6encap() call into IPv6, but do not test ipv6modenabled(). An lwtin prog also runs with ipv6.disable=1, and skb->protocol == htons(ETHPIPV6) does not prove that IPv6 is enabled. Thus the kernel dereferences NULL and crashes.
Return -EAFNOSUPPORT before these calls if ipv6modenabled() is false. BPFLWTREROUTE then drops an IPv6 skb. With IPv6 enabled nothing changes.
The first Fixes tag is for bpfpushseg6encap(), which never had this test. The second tag is for bpflwtinputreroute(). Until that commit it used ipv6stub, which returned -EAFNOSUPPORT with ipv6.disable=1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7 - Compensating control
In bpf_lwt_input_reroute() and bpf_push_seg6_encap(), return -EAFNOSUPPORT before calling into IPv6 when ipv6_mod_enabled() is false.
Event History
Frequently Asked Questions
Which systems are exposed to the crash condition?
Systems are exposed when IPv6 is disabled with ipv6.disable=1 and an lwt_in BPF program processes an IPv6 packet. In that state, IPv6 per-network data remains uninitialized, while the affected BPF paths can still call IPv6 functionality.
What conditions are required to trigger the issue?
An lwt_in program must reach bpf_lwt_input_reroute() or bpf_push_seg6_encap() for a packet whose protocol is IPv6. The issue occurs because the packet protocol alone does not establish that IPv6 is enabled.
What can be done if the fix cannot be applied immediately?
Avoid running the affected lwt_in BPF paths while IPv6 is disabled. Enabling IPv6 also avoids the uninitialized IPv6 state described here; with IPv6 enabled, the behavior is unchanged.
How does the corrected behavior handle these packets?
The corrected paths return -EAFNOSUPPORT when ipv6_mod_enabled() is false, before calling into IPv6. For BPF_LWT_REROUTE, this causes the IPv6 packet to be dropped rather than dereferencing NULL and crashing the kernel.