[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9efbb8a-4f48-9208-0615-087fb9e8e2d9@gmail.com>
Date: Sun, 17 Nov 2019 20:21:12 -0700
From: David Ahern <dsahern@...il.com>
To: "wangxiaogang (F)" <wangxiaogang3@...wei.com>, dsahern@...nel.org,
shrijeet@...il.com, davem@...emloft.net
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
hujunwei4@...wei.com, xuhanbing@...wei.com
Subject: Re: [PATCH] vrf: Fix possible NULL pointer oops when delete nic
On 11/17/19 8:16 PM, wangxiaogang (F) wrote:
>
>
> On 2019/11/16 0:59, David Ahern wrote:
>> On 11/14/19 11:22 PM, wangxiaogang (F) wrote:
>>> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
>>> index b8228f5..86c4b8c 100644
>>> --- a/drivers/net/vrf.c
>>> +++ b/drivers/net/vrf.c
>>> @@ -1427,6 +1427,9 @@ static int vrf_device_event(struct notifier_block *unused,
>>> goto out;
>>>
>>> vrf_dev = netdev_master_upper_dev_get(dev);
>>> + if (!vrf_dev)
>>> + goto out;
>>> +
>>> vrf_del_slave(vrf_dev, dev);
>>> }
>>> out:
>>
>> BTW, I believe this is the wrong fix. A device can not be a VRF slave
>> AND not have an upper device. Something is fundamentally wrong.
>>
>>
>
> this problem occurs when our testers deleted the NIC and vrf in parallel.
> I will try to recurring this problem later.
>
The deletes are serial in the kernel due to the rtnl, but dev changes
are under rcu...
Powered by blists - more mailing lists