CVE-2026-143358: bpf: Set a dst for test runs of lwt_in progs
In the Linux kernel, the following vulnerability has been resolved:
bpf: Set a dst for test runs of lwtin progs
When an lwt prog runs on a route, the skb always has a dst. To push an SRH, bpflwtpushencap() reads the device from this dst. But bpfprogtestrunskb() sets a dst for lwtxmit progs only. Thus the helper dereferences a NULL dst in a test run of an lwtin prog.
Set the same dst, ip6nullentry, for lwtin progs. When IPv6 is disabled or not built, their test run now fails with -EOPNOTSUPP too. An lwtout prog cannot call this helper.
Affected Software
Event History
Frequently Asked Questions
Who can trigger the NULL dereference?
A caller that can execute bpf_prog_test_run_skb() against an lwt_in BPF program and cause it to use bpf_lwt_push_encap() can trigger it. Normal lwt_in execution on a route is not described as affected because the skb has a destination in that path.
Are lwt_xmit or lwt_out programs affected in the same way?
lwt_xmit test runs already receive a destination. An lwt_out program cannot call bpf_lwt_push_encap(), so it is not affected by this helper path.
What happens to lwt_in test runs when IPv6 is disabled?
After the fix, lwt_in program test runs fail with -EOPNOTSUPP when IPv6 is disabled or not built, rather than proceeding without the required destination.