[libvirt] [PATCH 2/2] qemu: Prevent storage causing too much nested XML

Ján Tomko jtomko at redhat.com
Thu Sep 5 14:23:38 UTC 2019


On Wed, Sep 04, 2019 at 05:34:19PM +0200, Peter Krempa wrote:
>Since libvirt stores the backing chain into the XML in a nested way it
>is the prime possibility to hit libxml2's parsing limit of 256 layers.
>
>Introduce code which will crawl the backing chain and verify that it's
>not too deep. The maximum nesting is set to 200 layers so that there's
>still some space left for attitional properties or nesting into snapshot
>XMLs.
>
>The check is applied to all disk use cases (starting, hotplug, media
>change) as well as block copy which changes image and snapshots.
>
>We simply report an error and refuse the operation.
>
>Without this check a restart of libvirtd would result in the status XML
>failing to be parsed and thus losing the VM.
>
>https://bugzilla.redhat.com/show_bug.cgi?id=1524278
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_domain.c | 57 +++++++++++++++++++++++++++++++++++++++++-
> src/qemu/qemu_domain.h |  4 +++
> src/qemu/qemu_driver.c |  6 +++++
> 3 files changed, 66 insertions(+), 1 deletion(-)
>

With the suggestions pointed out by Eric:
Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190905/f62c304a/attachment-0001.sig>


More information about the libvir-list mailing list