From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmjuD-0001wb-H1 for qemu-devel@nongnu.org; Tue, 20 May 2014 09:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmju5-0000BR-NB for qemu-devel@nongnu.org; Tue, 20 May 2014 09:16:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmju5-0000B7-FJ for qemu-devel@nongnu.org; Tue, 20 May 2014 09:16:25 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4KDGOfd005898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 May 2014 09:16:24 -0400 Date: Tue, 20 May 2014 15:16:22 +0200 From: Stefan Hajnoczi Message-ID: <20140520131622.GA22753@stefanha-thinkpad.redhat.com> References: <1400551247-4798-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1400551247-4798-1-git-send-email-famz@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: Fam Zheng Cc: Paolo Bonzini , qemu-devel@nongnu.org, uobergfe@redhat.com 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? Stefan