Re: [PATCH net] net: fix NULL pointer dereference in l3mdev_l3_rcv

From: David Ahern
Date: Tue Mar 18 2025 - 22:09:00 EST


On 3/18/25 3:07 AM, Wang Liang wrote:
>>> It seems to me that checking master->l3mdev_ops like this is racy.
>> vrf device leaves the l3mdev ops set; that is probably the better way
>> to go.
>
> Thanks.
>
> Only l3s ipvlan set the dev->l3mdev_ops to NULL at present, I will delete
> 'dev->l3mdev_ops = NULL' in ipvlan_l3s_unregister(), is that ok?
>

I think that avoids the race you saw. vrf has had the ops for 9 years or
so and not seen that problem.