[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.9] sheepdog: Fix crash in co_read_response
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH for-2.9] sheepdog: Fix crash in co_read_response() |
Date: |
Tue, 11 Apr 2017 16:13:29 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 |
On 11.04.2017 16:08, Kevin Wolf wrote:
> This fixes a regression introduced in commit 9d456654.
>
> aio_co_wake() can only be used to reenter a coroutine that was already
> previously entered, otherwise co->ctx is uninitialised and we access
> garbage. Using it immediately after qemu_coroutine_create() like in
> co_read_response() is wrong and causes segfaults.
>
> Replace the call with aio_co_enter(), which gets an explicit AioContext
> parameter and works even for new coroutines.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> Tested-by: Kashyap Chamarthy <address@hidden>
> ---
> block/sheepdog.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature