Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Don't let lwt_in progs call into IPv6 when it is disabled With ipv6.disable=1, inet6_init() returns before it registers any pernet subsystem. Thus net->ipv6.devconf_all and net->ipv6.seg6_data stay NULL. IS_ENABLED(CONFIG_IPV6) only says that the code is built in. bpf_lwt_input_reroute() and bpf_push_seg6_encap() call into IPv6, but do not test ipv6_mod_enabled(). An lwt_in prog also runs with ipv6.disable=1, and skb->protocol == htons(ETH_P_IPV6) does not prove that IPv6 is enabled. Thus the kernel dereferences NULL and crashes. Return -EAFNOSUPPORT before these calls if ipv6_mod_enabled() is false. BPF_LWT_REROUTE then drops an IPv6 skb. With IPv6 enabled nothing changes. The first Fixes tag is for bpf_push_seg6_encap(), which never had this test. The second tag is for bpf_lwt_input_reroute(). Until that commit it used ipv6_stub, which returned -EAFNOSUPPORT with ipv6.disable=1.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
fe94cc290f535709d3c5ebd1e472dfd0aec7ee79 to < ef5073375e48ae95b00788e7b32edfb92204f66aaffectedfe94cc290f535709d3c5ebd1e472dfd0aec7ee79 to < 95f1d5e4abb79fe85a54f7a46b41f297ce533c31affected
Linux Linux
Default version status: affected
4.18affected0 to < 4.18unaffected7.3.7 to ≤ 7.3.*unaffected7.4-rc2 to ≤ *unaffected