]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: domain: Prevent overflows in memory alignment code
authorPeter Krempa <pkrempa@redhat.com>
Tue, 1 Dec 2015 13:08:37 +0000 (14:08 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 4 Dec 2015 14:21:20 +0000 (15:21 +0100)
commit645881139b3d2c86acf9d644c3a1471520bc9e57
tree7a8198dabcd436b65748106ec00c1ddae78c60db
parente5fac00946139648feddf70eed941d3d5c936127
qemu: domain: Prevent overflows in memory alignment code

Since libvirt for dubious historical reasons stores memory size as
kibibytes, it's possible that the alignments done in the qemu code
overflow the the maximum representable size in bytes. The XML parser
code handles them in bytes in some stages. Prevent this by doing
overflow checks when alinging the size and add a test case.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1260576
src/qemu/qemu_domain.c
tests/qemuxml2argvdata/qemuxml2argv-memory-align-fail.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c