[Bug 672943] Re: virt-aa-helper crashes on random parts

2010-11-09 Thread wodny

** Attachment added: UUID/MAC generation
   https://bugs.launchpad.net/bugs/672943/+attachment/1727718/+files/minimal.xml

-- 
virt-aa-helper crashes on random parts
https://bugs.launchpad.net/bugs/672943
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libvirt in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 672943] Re: virt-aa-helper crashes on random parts

2010-11-09 Thread Jamie Strandboge
This is not a problem on Maverick and later:
$ cat /tmp/xml | /usr/lib/libvirt/virt-aa-helper -u 
libvirt-14412844-e1d1-4dfc-ad03-6adf185fa243 -c --dryrun
virt-aa-helper: error: could not parse XML
virt-aa-helper: error: could not get VM definition

** Also affects: libvirt (Ubuntu Lucid)
   Importance: Undecided
   Status: New

** Also affects: libvirt (Ubuntu Maverick)
   Importance: Undecided
   Status: New

** Also affects: libvirt (Ubuntu Natty)
   Importance: Undecided
   Status: New

** Changed in: libvirt (Ubuntu Maverick)
   Status: New = Invalid

** Changed in: libvirt (Ubuntu Natty)
   Status: New = Invalid

** Changed in: libvirt (Ubuntu Lucid)
   Status: New = Confirmed

-- 
virt-aa-helper crashes on random parts
https://bugs.launchpad.net/bugs/672943
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libvirt in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 672943] Re: virt-aa-helper crashes on random parts

2010-11-09 Thread Jamie Strandboge
I can confirm this on lucid:
$ /usr/lib/libvirt/virt-aa-helper -u 
libvirt-14412844-e1d1-4dfc-ad03-6adf185fa243 -c --dryrun  /tmp/xml

As mentioned, this is due to random_r crashing. In virt-aa-helper on
Lucid, this is triggered by the call to virDomainDefParseXML(), which
calls virUUIDGenerate(), which eventually calls virRandom() and then
random_r(). The problem is that virRandom() is called, but virt-aa-
helper never calls virRandomInitialize() (like is done in libvirt.c).

On maverick (libvirt 0.8.3), the original reproducer XML is considered
invalid. Attached is XML that should trigger the flaw  there as well,
but only if /dev/urandom cannot by opened. The behavior changed because
of:

commit 28024f2311462d7f836e9f90aea805d1861b2abe
Author: Laine Stump la...@laine.org
Date:   Mon Jan 11 10:05:38 2010 +0100

Fix UUID random generator to use /dev/random

Only use pseudo-random generator for uuid if using /dev/random fails.
* src/util/uuid.c: The original code. would only print the warning
  message if using /dev/random failed, but would still go ahead and call
  virUUIDGeneratePseudoRandomBytes in all cases anyway.

So the reproducer is now:
$ sudo chmod 660 /dev/urandom
$ cat /tmp/672943.xml | /usr/lib/libvirt/virt-aa-helper -c -u 
libvirt-7d781722-69b7-8801-fe96-caf37b7a8968 --dryrun
...
Segmentation fault
$ sudo chmod 666 /dev/urandom

** Attachment added: 672943.xml
   
https://bugs.launchpad.net/ubuntu/lucid/+source/libvirt/+bug/672943/+attachment/1728108/+files/672943.xml

** Changed in: libvirt (Ubuntu Lucid)
   Status: Confirmed = Triaged

** Changed in: libvirt (Ubuntu Maverick)
   Status: Invalid = Triaged

** Changed in: libvirt (Ubuntu Natty)
   Status: Invalid = Triaged

-- 
virt-aa-helper crashes when domain XML does not contain uuid
https://bugs.launchpad.net/bugs/672943
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libvirt in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 672943] Re: virt-aa-helper crashes on random parts

2010-11-09 Thread Jamie Strandboge
wodny,

Were you able to trigger this via normal virsh (or something else like
virt-manager)? virt-aa-helper is not intended to be run by itself
(except for debugging) and this particular invocation should not ever
occur when using the userspace tools since 'create' and 'define' should
generate the UUID with libvirtd and then libvirtd will spawn virt-aa-
helper with the UUID in the XML. This is a bug that needs to be fixed,
but if it can't be triggered in the userspace tools then it probably
isn't something we would fix in the stable releases.

** Summary changed:

- virt-aa-helper crashes on random parts
+ virt-aa-helper crashes when domain XML does not contain uuid

** Changed in: libvirt (Ubuntu Natty)
 Assignee: (unassigned) = Jamie Strandboge (jdstrand)

-- 
virt-aa-helper crashes when domain XML does not contain uuid
https://bugs.launchpad.net/bugs/672943
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libvirt in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs