Re: [PATCH net v3 2/3] bpf: bpf_out_neigh_v6: Fix nd_tbl NULL dereference when IPv6 is disabled

From: Fernando Fernandez Mancera

Date: Fri Mar 06 2026 - 05:04:35 EST


On 3/6/26 3:25 AM, Jakub Kicinski wrote:
On Thu, 05 Mar 2026 18:29:56 -0300 Ricardo B. Marlière wrote:
+++ b/net/core/filter.c
@@ -2228,6 +2228,9 @@ static int bpf_out_neigh_v6(struct net *net, struct sk_buff *skb,
return -ENOMEM;
}
+ if (unlikely(!ipv6_stub->nd_tbl))
+ goto out_drop;

So neither Fernando nor you checked whether this code can be built
as a module? ipv6_mod_enabled() should work just fine


I checked it. If IPV6=m this is not fine.

ld: vmlinux.o: in function `bpf_out_neigh_v6':
filter.c:(.text+0x3231d60): undefined reference to `ipv6_mod_enabled'

SMH