Received: from eggs.gnu.org ([2001:4830:134:3::10]:53386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmwSc-00087n-4g for qemu-devel@nongnu.org; Tue, 20 May 2014 22:41:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmwSW-0005Cv-0V for qemu-devel@nongnu.org; Tue, 20 May 2014 22:40:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmwSV-00059E-NW for qemu-devel@nongnu.org; Tue, 20 May 2014 22:40:47 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4L2efMR012380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 May 2014 22:40:41 -0400 Date: Wed, 21 May 2014 10:40:42 +0800 From: Fam Zheng Message-ID: <20140521024042.GD18886@T430.nay.redhat.com> References: <1400551247-4798-1-git-send-email-famz@redhat.com> <20140520131622.GA22753@stefanha-thinkpad.redhat.com> <537B6042.10500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <537B6042.10500@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] aio: Fix use-after-free in cancellation path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , uobergfe@redhat.com On Tue, 05/20 16:01, Paolo Bonzini wrote: > Il 20/05/2014 15:16, Stefan Hajnoczi ha scritto: > >On Tue, May 20, 2014 at 10:00:47AM +0800, Fam Zheng wrote: > >>diff --git a/thread-pool.c b/thread-pool.c > >>index fbdd3ff..d4984ba 100644 > >>--- a/thread-pool.c > >>+++ b/thread-pool.c > >>@@ -223,6 +223,7 @@ static void thread_pool_cancel(BlockDriverAIOCB *acb) > >> } > >> pool->pending_cancellations--; > >> } > >>+ event_notifier_ready(&pool->notifier); > >> qemu_mutex_unlock(&pool->lock); > >> } > > > >event_notifier_ready() doesn't need pool->lock. Can you call it outside > >the lock or am I missing something? > > Yes, in fact I'm a bit wary of calling it inside the lock. OK, thanks. Fam