From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754719AbbCMB1c (ORCPT ); Thu, 12 Mar 2015 21:27:32 -0400 Received: from ozlabs.org ([103.22.144.67]:59409 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752349AbbCMB10 (ORCPT ); Thu, 12 Mar 2015 21:27:26 -0400 From: Rusty Russell To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , "David S. Miller" , v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org Subject: Re: [PATCH] 9p/trans_virtio: fix hot-unplug In-Reply-To: <20150312073545-mutt-send-email-mst@redhat.com> References: <20150309154814-mutt-send-email-mst@redhat.com> <874mprxb2d.fsf@rustcorp.com.au> <20150312073545-mutt-send-email-mst@redhat.com> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Fri, 13 Mar 2015 11:54:30 +1030 Message-ID: <8761a5wuy9.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Michael S. Tsirkin" writes: > On Thu, Mar 12, 2015 at 11:54:10AM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On device hot-unplug, 9p/virtio currently will kfree channel while >> > it might still be in use. >> > >> > Of course, it might stay used forever, so it's an extremely ugly hack, >> > but it seems better than use-after-free that we have now. >> > >> > Signed-off-by: Michael S. Tsirkin >> >> I'll apply it, but it looks like a bandaid. > > > Absolutely. Applied this, too: Signed-off-by: Rusty Russell diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 73fab71397ce..781315d97ed5 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -659,7 +659,6 @@ static void p9_virtio_remove(struct virtio_device *vdev) { struct virtio_chan *chan = vdev->priv; unsigned long warning_time; - bool inuse; mutex_lock(&virtio_9p_lock);