qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 02/23] mirror: Fix access of uninitialised fields during star


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 02/23] mirror: Fix access of uninitialised fields during start
Date: Wed, 22 Feb 2023 19:32:09 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 03.02.23 18:21, Kevin Wolf wrote:
bdrv_mirror_top_pwritev() accesses the job object when active mirroring
is enabled. It disables this code during early initialisation while
s->job isn't set yet.

However, s->job is still set way too early when the job object isn't
fully initialised. For example, &s->ops_in_flight isn't initialised yet
and the in_flight bitmap doesn't exist yet. This causes crashes when a
write request comes in too early.

Move the assignment of s->job to when the mirror job is actually fully
initialised to make sure that the mirror_top driver doesn't access it
too early.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Probably bitmap initialization and (maybe) some other things in mirror_run() 
should actually be done in mirror_start_job(). Still:

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


--
Best regards,
Vladimir




reply via email to

[Prev in Thread] Current Thread [Next in Thread]