[libvirt] [PATCH] Fix crash parsing RNG device specification

Eric Blake eblake at redhat.com
Thu Mar 7 14:06:42 UTC 2013


On 03/07/2013 04:58 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Code that validates the whitelist for the RNG device filename
> didn't account for fact that filename may be NULL. This led
> to a NULL reference crash. This wasn't caught since the test
> suite was not covering this XML syntax
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/conf/domain_conf.c                             |  3 ++-
>  .../qemuxml2argv-virtio-rng-default.args           |  6 ++++++
>  .../qemuxml2argv-virtio-rng-default.xml            | 23 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  2 ++
>  4 files changed, 33 insertions(+), 1 deletion(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.xml

This in turn triggers a test failure - we have to change the schema to
allow for a default value.  I'm pushing this:

diff --git i/docs/schemas/domaincommon.rng w/docs/schemas/domaincommon.rng
index 4b60885..372aab7 100644
--- i/docs/schemas/domaincommon.rng
+++ w/docs/schemas/domaincommon.rng
@@ -3514,6 +3514,7 @@
           <choice>
             <value>/dev/random</value>
             <value>/dev/hwrng</value>
+            <empty/>
           </choice>
         </group>
         <group>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130307/43477622/attachment-0001.sig>


More information about the libvir-list mailing list