From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42062 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PB8U1-0004xd-Mz for qemu-devel@nongnu.org; Wed, 27 Oct 2010 12:04:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PB8U0-0007BO-Ib for qemu-devel@nongnu.org; Wed, 27 Oct 2010 12:04:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PB8U0-0007BE-CO for qemu-devel@nongnu.org; Wed, 27 Oct 2010 12:04:12 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9RG4Bfu029256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 27 Oct 2010 12:04:11 -0400 Date: Wed, 27 Oct 2010 20:03:43 +0200 From: "Michael S. Tsirkin" Message-ID: <20101027180343.GA27426@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] tap: clear vhost_net backend on cleanup List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: qemu-devel@nongnu.org Frontends calling tap_get_vhost_net get an invalid pointer after the peer backend has been deleted. Jason Wang 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 --- 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