[libvirt] [PATCH 2/5] qemu: Avoid using stale data in virDomainGetBlockInfo

Eric Blake eblake at redhat.com
Tue Jan 7 15:01:57 UTC 2014


On 01/07/2014 07:22 AM, Jiri Denemark wrote:
> On Tue, Dec 24, 2013 at 07:22:38 -0700, Eric Blake wrote:
>> On 12/20/2013 02:36 PM, Jiri Denemark wrote:
>>> Generally, every API that is going to begin a job should do that before
>>> fetching data from vm->def. However, qemuDomainGetBlockInfo does not
>>> know whether it will have to start a job or not before checking vm->def.
>>> To avoid using disk alias that might have been freed while we were
>>> waiting for a job, we use its copy. In case the disk was removed in the
>>> meantime, we will fail with "cannot find statistics for device '...'"
>>> error message.
>>>
>>> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
>>> ---
>>>  src/qemu/qemu_driver.c | 17 ++++++++++++-----
>>>  1 file changed, 12 insertions(+), 5 deletions(-)
>>
>> This fixes the potential for a crash, but isn't this related to the same
>> problem that John has been working on?  That is, when one thread is
>> migrating a domain and the other is getting block info, we have a race
>> where qemu will quit before we get a chance to probe for the block info.
>> https://www.redhat.com/archives/libvir-list/2013-December/msg00984.html
>>
>> Would changing when we grab the job (and grabbing it unconditionally,
>> even if we end up not needing to query) help solve both issues?
> 
> I might help with what John was trying to do but I don't think this
> patch alone would solve the issue. May I consider this patch ACKed? :-)

I was debating whether a single patch could solve both issues at once,
to avoid rebase churn; but at this point, given that it solves a CVE,
I'm okay giving ACK to your patch as-is.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140107/8c136af8/attachment-0001.sig>


More information about the libvir-list mailing list