From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOp8m-0005I9-En for qemu-devel@nongnu.org; Fri, 20 Feb 2015 10:05:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOp8j-0004en-9r for qemu-devel@nongnu.org; Fri, 20 Feb 2015 10:05:16 -0500 Date: Fri, 20 Feb 2015 16:05:01 +0100 From: Kevin Wolf Message-ID: <20150220150501.GE4464@noname.redhat.com> References: <1423564888-14933-1-git-send-email-kwolf@redhat.com> <1423564888-14933-2-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423564888-14933-2-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/3] coroutine: Fix use after free with qemu_coroutine_yield() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com, pl@kamp.de, qemu-stable@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, wu.wubin@huawei.com Am 10.02.2015 um 11:41 hat Kevin Wolf geschrieben: > Instead of using the same function for entering and exiting coroutines, > and hoping that it doesn't add any functionality that hurts with the > parameters used for exiting, we can just directly call into the real > task switch in qemu_coroutine_switch(). > > This fixes a use-after-free scenario where reentering a coroutine that > has yielded still accesses the old parent coroutine (which may have > meanwhile terminated) in the part of coroutine_swap() that follows > qemu_coroutine_switch(). > > Signed-off-by: Kevin Wolf Cc: qemu-stable@nongnu.org Thanks to Peter for noticing that I forgot this. Kevin