From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmkc4-0007qI-V4 for qemu-devel@nongnu.org; Tue, 20 May 2014 10:02:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmkbw-0007Qx-2N for qemu-devel@nongnu.org; Tue, 20 May 2014 10:01:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmkbv-0007Qr-RI for qemu-devel@nongnu.org; Tue, 20 May 2014 10:01:44 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4KE1g2H025755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 May 2014 10:01:42 -0400 Message-ID: <537B6042.10500@redhat.com> Date: Tue, 20 May 2014 16:01:38 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1400551247-4798-1-git-send-email-famz@redhat.com> <20140520131622.GA22753@stefanha-thinkpad.redhat.com> In-Reply-To: <20140520131622.GA22753@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Stefan Hajnoczi , Fam Zheng Cc: qemu-devel@nongnu.org, uobergfe@redhat.com 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. Paolo