]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: fix crash when parsing a unordered NUMA <cell/>
authorLuyao Huang <lhuang@redhat.com>
Tue, 8 Sep 2015 04:59:10 +0000 (12:59 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Sep 2015 08:40:20 +0000 (10:40 +0200)
commit83ae3ee39bd13feddecc49aaad382d5cae72c257
tree671699cfd939aba3c13d251808dce0972b791a2b
parentccae95d50e91dd7f210ec22203f32d144f891ef4
conf: fix crash when parsing a unordered NUMA <cell/>

https://bugzilla.redhat.com/show_bug.cgi?id=1260846

Introduced by 8fedbbdb, if we parse an unordered NUMA cell, will
get a segfault. This is because of a check for overlapping @cpus
sets we have there. However, since the array to hold guest NUMA
cells is allocated upfront and therefore it contains all zeros,
an out of order cell will break our assumption that cell IDs have
increasing character. At this point we try to access yet NULL
bitmap and therefore segfault.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
src/conf/numa_conf.c
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disordered.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa-disordered.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c