From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: David Miller <davem@davemloft.net>
Cc: <xen-devel@lists.xenproject.org>, <boris.ostrovsky@oracle.com>,
<jgross@suse.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] xen-netfront: Fix race between device setup and open
Date: Thu, 11 Jan 2018 15:49:07 +0000 [thread overview]
Message-ID: <f297b1a4-d287-ba66-ad44-bf6073950bdf@citrix.com> (raw)
In-Reply-To: <20180111.102622.769744562294438306.davem@davemloft.net>
On 01/11/2018 03:26 PM, David Miller wrote:
> From: Ross Lagerwall <ross.lagerwall@citrix.com>
> Date: Thu, 11 Jan 2018 09:36:38 +0000
>
>> When a netfront device is set up it registers a netdev fairly early on,
>> before it has set up the queues and is actually usable. A userspace tool
>> like NetworkManager will immediately try to open it and access its state
>> as soon as it appears. The bug can be reproduced by hotplugging VIFs
>> until the VM runs out of grant refs. It registers the netdev but fails
>> to set up any queues (since there are no more grant refs). In the
>> meantime, NetworkManager opens the device and the kernel crashes trying
>> to access the queues (of which there are none).
>>
>> Fix this in two ways:
>> * For initial setup, register the netdev much later, after the queues
>> are setup. This avoids the race entirely.
>> * During a suspend/resume cycle, the frontend reconnects to the backend
>> and the queues are recreated. It is possible (though highly unlikely) to
>> race with something opening the device and accessing the queues after
>> they have been destroyed but before they have been recreated. Extend the
>> region covered by the rtnl semaphore to protect against this race. There
>> is a possibility that we fail to recreate the queues so check for this
>> in the open function.
>>
>> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
>
> Where is patch 1/2 and the 0/2 header posting which explains what this
> patch series is doing, how it is doing it, and why it is doing it that
> way?
>
I've now added CC'd netdev on the other two.
Cheers,
--
Ross Lagerwall
next prev parent reply other threads:[~2018-01-11 15:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 9:36 [PATCH 0/2] Fix a couple of crashes in netfront Ross Lagerwall
2018-01-11 9:36 ` [PATCH 1/2] xen/grant-table: Use put_page instead of free_page Ross Lagerwall
2018-01-11 15:48 ` Ross Lagerwall
2018-01-16 18:47 ` Boris Ostrovsky
2018-01-11 9:36 ` [PATCH 2/2] xen-netfront: Fix race between device setup and open Ross Lagerwall
2018-01-11 15:26 ` David Miller
2018-01-11 15:49 ` Ross Lagerwall [this message]
2018-01-11 16:08 ` David Miller
2018-01-11 16:27 ` Ross Lagerwall
2018-01-11 16:36 ` David Miller
2018-01-16 18:56 ` Boris Ostrovsky
2018-01-11 15:48 ` [PATCH 0/2] Fix a couple of crashes in netfront Ross Lagerwall
2018-02-06 14:52 ` Juergen Gross
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=f297b1a4-d287-ba66-ad44-bf6073950bdf@citrix.com \
--to=ross.lagerwall@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=davem@davemloft.net \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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
all inboxes | Powered by JetHome®