]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
conf: Don't crash on invalid chardev source definition of RNGs and other
authorPeter Krempa <pkrempa@redhat.com>
Thu, 26 Sep 2013 06:12:39 +0000 (08:12 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 26 Sep 2013 06:48:38 +0000 (08:48 +0200)
commit795527548fea79902ea4ce32747e069944cf3e61
tree1e35b11a51d43f8a82ee90d46af1af41708d6fbc
parente23216da9a9318df920abb11b02582b81515c862
conf: Don't crash on invalid chardev source definition of RNGs and other

Since commit 297c99a5 an invalid source definition XML of a character
device that is used as backend for RNG devices, smartcards and redirdevs
causes crash of the daemon when parsing such a definition.

The device types mentioned above are not a part of a regular character
device but are backends for other types. Thus when parsing such device
NULL is passed as the argument @chr_def. Later when checking the
validity of the definition @chr_def was dereferenced when parsing a UNIX
socket backend with missing path of the socket and crashed the daemon.

Sample offending configuration:
  <devices>
  ...
    <rng model='virtio'>
      <backend model='egd' type='unix'>
        <source mode='bind' service='1024'/>
      </backend>
    </rng>
  </devices>

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1012196
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd-crash.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c