From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] tap: clear vhost_net backend on cleanup
Date: Wed, 27 Oct 2010 20:03:43 +0200 [thread overview]
Message-ID: <20101027180343.GA27426@redhat.com> (raw)
Frontends calling tap_get_vhost_net get an invalid pointer after the
peer backend has been deleted. Jason Wang <jasowang@redhat.com> reports
this leading to a crash in ack_features when we remove the vhost-net
bakend of a virtio nic.
The fix is simply to clear the backend pointer.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
Jason, could you please confirm whether this patch
will fix the issue you have observed?
Thanks,
net/tap.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index 0147dab..4cfa538 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -258,6 +258,7 @@ static void tap_cleanup(VLANClientState *nc)
if (s->vhost_net) {
vhost_net_cleanup(s->vhost_net);
+ s->vhost_net = NULL;
}
qemu_purge_queued_packets(nc);
--
1.7.3.2.91.g446ac
next reply other threads:[~2010-10-27 16:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-27 18:03 Michael S. Tsirkin [this message]
2010-10-28 7:40 ` [Qemu-devel] [PATCH] tap: clear vhost_net backend on cleanup Jason Wang
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=20101027180343.GA27426@redhat.com \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.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).