From patchwork Fri Mar 13 01:24:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rusty Russell X-Patchwork-Id: 449729 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3B2BF140119 for ; Fri, 13 Mar 2015 12:27:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbbCMB11 (ORCPT ); Thu, 12 Mar 2015 21:27:27 -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 Received: by ozlabs.org (Postfix, from userid 1011) id 555D51400EA; Fri, 13 Mar 2015 12:27:25 +1100 (AEDT) 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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);