public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: "wangxiaogang (F)" <wangxiaogang3@huawei.com>,
	dsahern@kernel.org, shrijeet@gmail.com, davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	hujunwei4@huawei.com, xuhanbing@huawei.com
Subject: Re: [PATCH] vrf: Fix possible NULL pointer oops when delete nic
Date: Sun, 17 Nov 2019 20:21:12 -0700	[thread overview]
Message-ID: <a9efbb8a-4f48-9208-0615-087fb9e8e2d9@gmail.com> (raw)
In-Reply-To: <bead86fd-ae33-219f-0601-d80b57695d3c@huawei.com>

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...

  reply	other threads:[~2019-11-18  3:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15  6:22 [PATCH] vrf: Fix possible NULL pointer oops when delete nic wangxiaogang (F)
2019-11-15 13:14 ` David Ahern
2019-11-18  3:15   ` wangxiaogang (F)
2019-11-18  3:22     ` David Ahern
2019-11-15 16:59 ` David Ahern
2019-11-18  3:16   ` wangxiaogang (F)
2019-11-18  3:21     ` David Ahern [this message]
2019-11-16 20:53 ` David Miller
2019-11-17  6:17   ` Taehee Yoo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9efbb8a-4f48-9208-0615-087fb9e8e2d9@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=hujunwei4@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shrijeet@gmail.com \
    --cc=wangxiaogang3@huawei.com \
    --cc=xuhanbing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox