From: "Michael S. Tsirkin" <mst@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org, Eric Van Hensbergen <ericvh@gmail.com>,
netdev@vger.kernel.org,
virtualization@lists.linux-foundation.org,
v9fs-developer@lists.sourceforge.net,
Ron Minnich <rminnich@sandia.gov>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH v2 14/15] 9p/trans_virtio: enable VQs early
Date: Mon, 6 Oct 2014 18:11:29 +0300 [thread overview]
Message-ID: <1412608214-31944-15-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1412608214-31944-1-git-send-email-mst@redhat.com>
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after probe returns, but virtio 9p device
adds self to channel list within probe, at which point VQ can be
used in violation of the spec.
To fix, call virtio_enable_vqs_early before using VQs.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
net/9p/trans_virtio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 6940d8f..766ba48 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -575,6 +575,8 @@ static int p9_virtio_probe(struct virtio_device *vdev)
/* Ceiling limit to avoid denial of service attacks */
chan->p9_max_pages = nr_free_buffer_pages()/4;
+ virtio_enable_vqs_early(vdev);
+
mutex_lock(&virtio_9p_lock);
list_add_tail(&chan->chan_list, &virtio_chan_list);
mutex_unlock(&virtio_9p_lock);
--
MST
next prev parent reply other threads:[~2014-10-06 15:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1412608214-31944-1-git-send-email-mst@redhat.com>
2014-10-06 15:11 ` [PATCH v2 07/15] virtio_net: drop config_enable Michael S. Tsirkin
2014-10-06 15:28 ` Cornelia Huck
2014-10-06 15:11 ` [PATCH v2 08/15] virtio-net: drop config_mutex Michael S. Tsirkin
2014-10-06 15:11 ` [PATCH v2 09/15] virtio_net: minor cleanup Michael S. Tsirkin
2014-10-06 15:11 ` [PATCH v2 11/15] virtio_net: enable VQs early Michael S. Tsirkin
2014-10-06 15:39 ` Cornelia Huck
2014-10-06 15:11 ` Michael S. Tsirkin [this message]
2014-10-06 15:11 ` [PATCH v2 15/15] virtio_net: fix use after free on allocation failure Michael S. Tsirkin
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=1412608214-31944-15-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=ericvh@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rminnich@sandia.gov \
--cc=v9fs-developer@lists.sourceforge.net \
--cc=virtualization@lists.linux-foundation.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;
as well as URLs for NNTP newsgroup(s).