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 <pkre...@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 <jto...@redhat.com>

Jano

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to