Re: [PATCH net] net: bridge: fix nd_tbl NULL dereference when IPv6 is disabled

Fernando Fernandez Mancera
2026-03-01T18:28:12Z

On 2/28/26 9:30 PM, Jakub Kicinski wrote:
> On Fri, 27 Feb 2026 00:40:59 +0100 Fernando Fernandez Mancera wrote:
>> Fix this by adding a check before br_is_local_ip6() or neigh_lookup()
>> call. If ipv6_stub->nd_tbl is NULL, return immediately.
>
> The problem should probably be fixed by replacing IS_ENABLED(IPV6) in
> the callers with ipv6_mod_enabled(), rather than randomly sprinkling
> null checks?
>

I agree about using ipv6__mod_enabled() instead of the NULL check.
Thanks for that recommendation, although I do not agree with replacing
IS_ENABLED(IPV6) because here there is some ND message suppression that
can be applied and at the end bridge should not be look to L3 unless
necessary.

E.g NUD is still being suppressed even if ipv6 is disabled on boot.

What do you think? Thanks.

>> Fixes: ed842faeb2bd ("bridge: suppress nd pkts on BR_NEIGH_SUPPRESS ports")
>> Closes: https://lore.kernel.org/netdev/CAHXs0ORzd62QOG-Fttqa2Cx_A_VFp=utE2H2VTX5nqfgs7LDxQ@mail.gmail.com/
>
> I think we should also have a Reported-by: in this case?

Yep, sorry about that. Adding it on the next revision.