]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: Prevent coroutine stack overflow when recursing in bdrv_open_backing_file.
authorBenoît Canet <benoit.canet@irqsave.net>
Tue, 22 Apr 2014 15:05:27 +0000 (17:05 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 21 Jul 2014 03:05:57 +0000 (22:05 -0500)
commit7dfa87e9cb3c6c84a787b68de0cd607247129464
tree48ac08c8e985881a841e5314dba29773b39521aa
parent7b0387ad9091dd98088373e89d010140aefad3e4
block: Prevent coroutine stack overflow when recursing in bdrv_open_backing_file.

In 1.7.1 qcow2_create2 reopen the file for flushing without the BDRV_O_NO_BACKING
flags.

As a consequence the code would recursively open the whole backing chain.

These three stack arrays would pile up through the recursion and lead to a coroutine
stack overflow.

Convert these array to malloced buffers in order to streamline the coroutine
footprint.

Symptoms where freezes or segfaults on production machines while taking QMP externals
snapshots. The overflow disturbed coroutine switching.

[Resolved conflicts on qemu.git/master since the patch was against v1.7.1
--Stefan]

Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 1ba4b6a553ad9ff4645af7fab8adfc6e810fcc69)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block.c