Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Salvatore Bonaccorso
Control: severity -1 grave

Hi

On Sun, Mar 17, 2013 at 12:16:19AM +0100, TomaszSz wrote:
 Package: libvirt0
 Version: 0.8.3-5+squeeze4
 Severity: normal
[...]
 My virtual machines doesn't start also.
 In my /var/log/libvirt/qemu/mymachine.log i get this information:
 LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 
 HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 16384 
 -smp 
 4,sockets=4,cores=1,threads=1 -name win2008-STD-orion -uuid 
 66a2dc8c-dd85-38da-ab66-405784525dce -nodefaults -chardev 
 socket,id=monitor,path=/var/lib/libvirt/qemu/win2008-STD-orion.monitor,server,nowait
  -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive 
 if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device 
 ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive 
 file=/home/images/win2k8_std_orion.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw
  -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 
 -device e1000,vlan=0,id=net0,mac=52:54:00:f5:78:57,bus=pci.0,addr=0x3 -net 
 tap,fd=63,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device 
 isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 
 -k pl -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 char 
 device redirected to /dev/pts/3 open /dev/kvm: Permission denied Could not 
 initialize KVM, will disable KVM support 

I can confirm this, upgrading from 0.8.3-5+squeeze2 to
0.8.3-5+squeeze4 is causing this regression:

open /dev/kvm: Permission denied
Could not initialize KVM, will disable KVM support

This seems related to the changes done for #701649, but I had not time
to check further.

Cc'ing also the security team.

Regards,
Salvatore


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Guido Günther
On Sun, Mar 17, 2013 at 12:16:19AM +0100, TomaszSz wrote:
 Package: libvirt0
 Version: 0.8.3-5+squeeze4
 Severity: normal
 
 Hi,
 After actualisation of libvirt-bin, libvirt0, python-libvirt from version 
 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4 i get an error in kern.log:
 Mar 16 21:45:27 ursaminor kernel: [894014.541626] kvm[28358]: segfault at 0 
 ip 004e3ef0 sp 7fffbec469f0 error 4 in kvm[40+238000]
 Mar 16 21:57:11 ursaminor kernel: [  165.92] kvm[5029]: segfault at 0 ip 
 004e3ef0 sp 7fff455d9fd0 error 4 in kvm[40+238000]
 Mar 16 22:04:29 ursaminor kernel: [  603.405960] kvm[5862]: segfault at 0 ip 
 004e3ef0 sp 7fff8d2c4810 error 4 in kvm[40+238000]
 Mar 16 22:08:55 ursaminor kernel: [  869.664001] kvm[6347]: segfault at 0 ip 
 004e3ef0 sp 7fffbd9a8000 error 4 in kvm[40+238000]
 Mar 16 22:14:29 ursaminor kernel: [ 1203.397581] kvm[7016]: segfault at 0 ip 
 004e3ef0 sp 7fffad92ac40 error 4 in kvm[40+238000]
 Mar 16 22:14:44 ursaminor kernel: [ 1218.385540] kvm[7047]: segfault at 0 ip 
 004e3ef0 sp 7fffb106e530 error 4 in kvm[40+238000]
 
 My virtual machines doesn't start also.
 In my /var/log/libvirt/qemu/mymachine.log i get this information:
 LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 
 HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 16384 
 -smp 
 4,sockets=4,cores=1,threads=1 -name win2008-STD-orion -uuid 
 66a2dc8c-dd85-38da-ab66-405784525dce -nodefaults -chardev 
 socket,id=monitor,path=/var/lib/libvirt/qemu/win2008-STD-orion.monitor,server,nowait
  -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive 
 if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device 
 ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive 
 file=/home/images/win2k8_std_orion.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw
  -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 
 -device e1000,vlan=0,id=net0,mac=52:54:00:f5:78:57,bus=pci.0,addr=0x3 -net 
 tap,fd=63,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device 
 isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 
 -k pl -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 char 
 device redirected to /dev/pts/3 open /dev/kvm: Permission denied Could not 
 initialize KVM, will disable KVM support 

There seems to be an issue opening /dev/kvm (it shouldn't crash though).
The patch changed the group libvirt runs the kvm process with but the
kvm group should still be a supplementary group.

Please check:

ls -l /dev/kvm

id libvirt-qemu

getent group kvm

and attach /etc/libvirt/qemu.conf.
Cheers,
 -- Guido

 
 Any one can help me please?
 
 -- System Information:
 Debian Release: 6.0.7
   APT prefers stable-updates
   APT policy: (500, 'stable-updates'), (500, 'stable')
 Architecture: amd64 (x86_64)
 
 Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
 Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
 Shell: /bin/sh linked to /bin/dash
 
 Versions of packages libvirt0 depends on:
 ii  libc6  2.11.3-4  Embedded GNU C Library: Shared 
 lib
 ii  libcap-ng0 0.6.4-1   An alternate posix capabilities 
 li
 ii  libgcrypt111.4.5-2   LGPL Crypto library - runtime 
 libr
 ii  libgnutls262.8.6-1+squeeze2  the GNU TLS library - runtime 
 libr
 ii  libnl1 1.1-6 library for dealing with netlink 
 s
 ii  libsasl2-2 2.1.23.dfsg1-7Cyrus SASL - authentication 
 abstra
 ii  libxenstore3.0 4.0.1-5.8 Xenstore communications library 
 fo
 ii  libxml22.7.8.dfsg-2+squeeze6 GNOME XML library
 
 Versions of packages libvirt0 recommends:
 ii  lvm2  2.02.66-5  The Linux Logical Volume Manager
 
 libvirt0 suggests no packages.
 
 -- no debconf information
 
 ___
 Pkg-libvirt-maintainers mailing list
 pkg-libvirt-maintain...@lists.alioth.debian.org
 http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-libvirt-maintainers
 


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Guido Günther
Hi Salvatore,
On Sun, Mar 17, 2013 at 08:56:51AM +0100, Salvatore Bonaccorso wrote:
 Control: severity -1 grave
 
 Hi
 
 On Sun, Mar 17, 2013 at 12:16:19AM +0100, TomaszSz wrote:
  Package: libvirt0
  Version: 0.8.3-5+squeeze4
  Severity: normal
 [...]
  My virtual machines doesn't start also.
  In my /var/log/libvirt/qemu/mymachine.log i get this information:
  LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 
  HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 16384 
  -smp 
  4,sockets=4,cores=1,threads=1 -name win2008-STD-orion -uuid 
  66a2dc8c-dd85-38da-ab66-405784525dce -nodefaults -chardev 
  socket,id=monitor,path=/var/lib/libvirt/qemu/win2008-STD-orion.monitor,server,nowait
   -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive 
  if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device 
  ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive 
  file=/home/images/win2k8_std_orion.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw
   -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 
  -device e1000,vlan=0,id=net0,mac=52:54:00:f5:78:57,bus=pci.0,addr=0x3 -net 
  tap,fd=63,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device 
  isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 
  127.0.0.1:1 -k pl -vga std -device 
  virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 char 
  device redirected to /dev/pts/3 open /dev/kvm: Permission denied Could not 
  initialize KVM, will disable KVM support 
 
 I can confirm this, upgrading from 0.8.3-5+squeeze2 to
 0.8.3-5+squeeze4 is causing this regression:
 
 open /dev/kvm: Permission denied
 Could not initialize KVM, will disable KVM support
 
 This seems related to the changes done for #701649, but I had not time
 to check further.

Thanks for double checking. I do wonder why I didn't see this during my
test though. A temporary work around is to set group = kvm in
/etc/libvirt/qemu.conf .

This of course results in files being owned by the kvm group (which is
what we wanted to avoid in the first place).

Cheers, 
 -- Guido

 
 Cc'ing also the security team.
 
 Regards,
 Salvatore
 
 ___
 Pkg-libvirt-maintainers mailing list
 pkg-libvirt-maintain...@lists.alioth.debian.org
 http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-libvirt-maintainers
 


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Yves-Alexis Perez
On dim., 2013-03-17 at 08:56 +0100, Salvatore Bonaccorso wrote:
 open /dev/kvm: Permission denied
 Could not initialize KVM, will disable KVM support

Can you check permissions on the /dev/kvm device and the groups in which
the libvirt-qemu user is?

Regards,
-- 
Yves-Alexis


signature.asc
Description: This is a digitally signed message part


Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Guido Günther
On Sun, Mar 17, 2013 at 12:08:05PM +0100, Guido Günther wrote:
 Hi Salvatore,
 On Sun, Mar 17, 2013 at 08:56:51AM +0100, Salvatore Bonaccorso wrote:
  Control: severity -1 grave
  
  Hi
  
  On Sun, Mar 17, 2013 at 12:16:19AM +0100, TomaszSz wrote:
   Package: libvirt0
   Version: 0.8.3-5+squeeze4
   Severity: normal
  [...]
   My virtual machines doesn't start also.
   In my /var/log/libvirt/qemu/mymachine.log i get this information:
   LC_ALL=C 
   PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/ 
   QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 16384 -smp 
   4,sockets=4,cores=1,threads=1 -name win2008-STD-orion -uuid 
   66a2dc8c-dd85-38da-ab66-405784525dce -nodefaults -chardev 
   socket,id=monitor,path=/var/lib/libvirt/qemu/win2008-STD-orion.monitor,server,nowait
-mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive 
   if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device 
   ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive 
   file=/home/images/win2k8_std_orion.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 
   -device e1000,vlan=0,id=net0,mac=52:54:00:f5:78:57,bus=pci.0,addr=0x3 
   -net tap,fd=63,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device 
   isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 
   127.0.0.1:1 -k pl -vga std -device 
   virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 char 
   device redirected to /dev/pts/3 open /dev/kvm: Permission denied Could 
   not initialize KVM, will disable KVM support 
  
  I can confirm this, upgrading from 0.8.3-5+squeeze2 to
  0.8.3-5+squeeze4 is causing this regression:
  
  open /dev/kvm: Permission denied
  Could not initialize KVM, will disable KVM support
  
  This seems related to the changes done for #701649, but I had not time
  to check further.
 
 Thanks for double checking. I do wonder why I didn't see this during my
 test though. A temporary work around is to set group = kvm in
 /etc/libvirt/qemu.conf .

It turned out as expected. The necessary initgroups logic was added post
post 0.8.6 while squeeze has 0.8.3. (I also spotted the reason why my
testing on squeeze incorrectly succeeded to open /dev/kvm which was just
related to the local setup). I'll have a look into backporting the
relevant parts.

 This of course results in files being owned by the kvm group (which is
 what we wanted to avoid in the first place).

The alternative workaround is to change the group of /dev/kvm to allow
access for the libvirt-qemu group.
Cheers,
 -- Guido

 
 Cheers, 
  -- Guido
 
  
  Cc'ing also the security team.
  
  Regards,
  Salvatore
  
  ___
  Pkg-libvirt-maintainers mailing list
  pkg-libvirt-maintain...@lists.alioth.debian.org
  http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-libvirt-maintainers
  


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Salvatore Bonaccorso
Hi!

On Sun, Mar 17, 2013 at 12:29:45PM +0100, Yves-Alexis Perez wrote:
 On dim., 2013-03-17 at 08:56 +0100, Salvatore Bonaccorso wrote:
  open /dev/kvm: Permission denied
  Could not initialize KVM, will disable KVM support
 
 Can you check permissions on the /dev/kvm device and the groups in which
 the libvirt-qemu user is?

Only now back. It looks like Guido already found the issue. But here
for reference the settings on the system where I saw this too (tough
in my case the VMs do not crash):

# ls -l /dev/kvm
crw-rw 1 root kvm 10, 232 Mar 11 06:47 /dev/kvm
# id libvirt-qemu
uid=108(libvirt-qemu) gid=112(kvm) groups=112(kvm),115(libvirt-qemu)
# getent group kvm
kvm:x:112:

No special settings in /etc/libvirt/qemu.conf.

Regards,
Salvatore


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Yves-Alexis Perez
On dim., 2013-03-17 at 13:40 +0100, Salvatore Bonaccorso wrote:
 Only now back. It looks like Guido already found the issue. But here
 for reference the settings on the system where I saw this too (tough
 in my case the VMs do not crash):
 
 # ls -l /dev/kvm
 crw-rw 1 root kvm 10, 232 Mar 11 06:47 /dev/kvm
 # id libvirt-qemu
 uid=108(libvirt-qemu) gid=112(kvm) groups=112(kvm),115(libvirt-qemu)
 # getent group kvm
 kvm:x:112:

I'm a bit puzzled. It looks like libvirt-qemu user should have
permissions on kvm then.
-- 
Yves-Alexis


signature.asc
Description: This is a digitally signed message part


Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Guido Günther
On Sun, Mar 17, 2013 at 03:11:52PM +0100, Yves-Alexis Perez wrote:
 On dim., 2013-03-17 at 13:40 +0100, Salvatore Bonaccorso wrote:
  Only now back. It looks like Guido already found the issue. But here
  for reference the settings on the system where I saw this too (tough
  in my case the VMs do not crash):
  
  # ls -l /dev/kvm
  crw-rw 1 root kvm 10, 232 Mar 11 06:47 /dev/kvm
  # id libvirt-qemu
  uid=108(libvirt-qemu) gid=112(kvm) groups=112(kvm),115(libvirt-qemu)
  # getent group kvm
  kvm:x:112:
 
 I'm a bit puzzled. It looks like libvirt-qemu user should have
 permissions on kvm then.

Older libvirt (prior to 0.8.6) lack the proper initgroup calls. Without
these the process runs as libvirt-qemu:libvirt-qemu without any othter
group membership and therefore isn't allowed to access /dev/kvm.

That was the main motivation for using group kvm instead of separate
group in squeeze.

I vaguely remembered this when preparing the sec update and therefore
did extra testing but since the only kvm capable squeeze box around here
had a non standard setup (I need to test the stable as well as the
backports version on that one) this problem didn't show up and I didn't
check the code itself.

Cheers,
 -- Guido


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Guido Günther
Hi,
attached is a debdiff that fixes the issue. I'd be great if somebody
could check out the packages at:

http://honk.sigxcpu.org/projects/libvirt/snapshots/

I didn't squash the upstream commits so we can easily pull in more stuff
iff needed.
Cheers,
 -- Guido
diff --git a/debian/changelog b/debian/changelog
index 719b74e..867d751 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libvirt (0.8.3-5+squeeze5) stable-security; urgency=low
+
+  * [465cafd] Invoke initgroups when starting kvm
+so we don't fail to open /dev/kvm. (Closes: #703208)
+
+ -- Guido Günther a...@sigxcpu.org  Sun, 17 Mar 2013 14:39:03 +0100
+
 libvirt (0.8.3-5+squeeze4) stable-security; urgency=low
 
   * [9d7846f] CVE-2013-1766: Use libvirt-qemu as group to run qemu/kvm
diff --git a/debian/patches/0020-Rerun-autoconf.patch b/debian/patches/0020-Rerun-autoconf.patch
new file mode 100644
index 000..e74f0a8
--- /dev/null
+++ b/debian/patches/0020-Rerun-autoconf.patch
@@ -0,0 +1,35 @@
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= a...@sigxcpu.org
+Date: Sun, 17 Mar 2013 14:19:08 +0100
+Subject: Rerun autoconf
+
+---
+ config.h.in |3 +++
+ configure   |1 +
+ 2 files changed, 4 insertions(+)
+
+diff --git a/config.h.in b/config.h.in
+index 187fdbc..d839f22 100644
+--- a/config.h.in
 b/config.h.in
+@@ -452,6 +452,9 @@
+ /* Define to 1 if you have the `inet_pton' function. */
+ #undef HAVE_INET_PTON
+ 
++/* Define to 1 if you have the `initgroups' function. */
++#undef HAVE_INITGROUPS
++
+ /* Define if you have the 'intmax_t' type in stdint.h or inttypes.h. */
+ #undef HAVE_INTMAX_T
+ 
+diff --git a/configure b/configure
+index 37adb0a..f24ad5d 100755
+--- a/configure
 b/configure
+@@ -3009,6 +3009,7 @@ gl_func_list=$gl_func_list regexec
+ gl_func_list=$gl_func_list sched_getaffinity
+ gl_func_list=$gl_func_list getuid
+ gl_func_list=$gl_func_list getgid
++gl_func_list=$gl_func_list initgroups
+ gl_func_list=$gl_func_list posix_fallocate
+ gl_func_list=$gl_func_list mmap
+ gl_func_list=$gl_func_list strerror_r
diff --git a/debian/patches/security/0017-New-virSetUIDGID-utility-function.patch b/debian/patches/security/0017-New-virSetUIDGID-utility-function.patch
new file mode 100644
index 000..80352d6
--- /dev/null
+++ b/debian/patches/security/0017-New-virSetUIDGID-utility-function.patch
@@ -0,0 +1,123 @@
+From: Laine Stump la...@laine.org
+Date: Sun, 17 Mar 2013 13:32:59 +0100
+Subject: New virSetUIDGID() utility function
+
+virSetUIDGID() sets both the real and effective group and user of the
+process, and additionally calls initgroups() to assure that the
+process joins all the auxiliary groups that the given uid is a member
+of.
+
+---
+ configure.ac|2 +-
+ src/util/util.c |   64 +++
+ src/util/util.h |2 ++
+ 3 files changed, 67 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index cd48c1b..a075c58 100644
+--- a/configure.ac
 b/configure.ac
+@@ -93,7 +93,7 @@ AC_MSG_RESULT([$have_cpuid])
+ 
+ 
+ dnl Availability of various common functions (non-fatal if missing).
+-AC_CHECK_FUNCS_ONCE([cfmakeraw regexec sched_getaffinity getuid getgid \
++AC_CHECK_FUNCS_ONCE([cfmakeraw regexec sched_getaffinity getuid getgid initgroups \
+  posix_fallocate mmap])
+ 
+ dnl Availability of various not common threadsafe functions
+diff --git a/src/util/util.c b/src/util/util.c
+index 8f2a17e..08e6137 100644
+--- a/src/util/util.c
 b/src/util/util.c
+@@ -2748,6 +2748,61 @@ int virGetGroupID(const char *name,
+ return 0;
+ }
+ 
++
++/* Set the real and effective uid and gid to the given values, and call
++ * initgroups so that the process has all the assumed group membership of
++ * that uid. return 0 on success, -1 on failure.
++ */
++int
++virSetUIDGID(uid_t uid, gid_t gid)
++{
++if (gid  0) {
++if (setregid(gid, gid)  0) {
++virReportSystemError(errno,
++ _(cannot change to '%d' group), gid);
++return -1;
++}
++}
++
++if (uid  0) {
++# ifdef HAVE_INITGROUPS
++struct passwd pwd, *pwd_result;
++char *buf = NULL;
++size_t bufsize;
++
++bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
++if (bufsize == -1)
++bufsize = 16384;
++
++if (VIR_ALLOC_N(buf, bufsize)  0) {
++virReportOOMError();
++return -1;
++}
++getpwuid_r(uid, pwd, buf, bufsize, pwd_result);
++if (!pwd_result) {
++virReportSystemError(errno,
++ _(cannot getpwuid_r(%d)), uid);
++VIR_FREE(buf);
++return -1;
++}
++if (initgroups(pwd.pw_name, pwd.pw_gid)  0) {
++virReportSystemError(errno,
++ _(cannot initgroups(\%s\, %d)),
++ pwd.pw_name, pwd.pw_gid);
++VIR_FREE(buf);
++return -1;
++}

Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Yves-Alexis Perez
On dim., 2013-03-17 at 15:34 +0100, Guido Günther wrote:
 I vaguely remembered this when preparing the sec update and therefore
 did extra testing but since the only kvm capable squeeze box around
 here
 had a non standard setup (I need to test the stable as well as the
 backports version on that one) this problem didn't show up and I
 didn't
 check the code itself.

Ok. Can you quickly prepare an updated version and upload it to security
master so we can release a -2 for the regression?

Regards,
-- 
Yves-Alexis


signature.asc
Description: This is a digitally signed message part


Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Guido Günther
Hi,
On Sun, Mar 17, 2013 at 06:59:54PM +0100, Yves-Alexis Perez wrote:
 On dim., 2013-03-17 at 15:34 +0100, Guido Günther wrote:
  I vaguely remembered this when preparing the sec update and therefore
  did extra testing but since the only kvm capable squeeze box around
  here
  had a non standard setup (I need to test the stable as well as the
  backports version on that one) this problem didn't show up and I
  didn't
  check the code itself.
 
 Ok. Can you quickly prepare an updated version and upload it to security
 master so we can release a -2 for the regression?

Uploded. But can we please wait until somebody else confirms the
packages at 

http://honk.sigxcpu.org/projects/libvirt/snapshots/

are working for them?
Cheers,
 -- Guido

 
 Regards,
 -- 
 Yves-Alexis


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Yves-Alexis Perez
On dim., 2013-03-17 at 19:23 +0100, Guido Günther wrote:
 Uploded. But can we please wait until somebody else confirms the
 packages at 
 
 http://honk.sigxcpu.org/projects/libvirt/snapshots/
 
 are working for them?

Sure. Salvatore?
-- 
Yves-Alexis


signature.asc
Description: This is a digitally signed message part


Bug#703208: [Pkg-libvirt-maintainers] Bug#703208: Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-17 Thread Salvatore Bonaccorso
Hi 

On Sun, Mar 17, 2013 at 08:07:51PM +0100, Yves-Alexis Perez wrote:
 On dim., 2013-03-17 at 19:23 +0100, Guido Günther wrote:
  Uploded. But can we please wait until somebody else confirms the
  packages at 
  
  http://honk.sigxcpu.org/projects/libvirt/snapshots/
  
  are working for them?
 
 Sure. Salvatore?

I have tested the package in the environment where I confirmed the
problem this morning. With 0.8.3-5+squeeze5 the problems went away.

Further testing done was: with existing vm, create new snapshot,
revert, delete old snapshot. Worked all as expected in these cases.

Thanks for the quick followup!

Regards,
Salvatore


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#703208: libvirt0: segfault after upgrade from version 0.8.3-5+squeeze2 to 0.8.3-5+squeeze4

2013-03-16 Thread TomaszSz
Package: libvirt0
Version: 0.8.3-5+squeeze4
Severity: normal

Hi,
After actualisation of libvirt-bin, libvirt0, python-libvirt from version 
0.8.3-5+squeeze2 to 0.8.3-5+squeeze4 i get an error in kern.log:
Mar 16 21:45:27 ursaminor kernel: [894014.541626] kvm[28358]: segfault at 0 ip 
004e3ef0 sp 7fffbec469f0 error 4 in kvm[40+238000]
Mar 16 21:57:11 ursaminor kernel: [  165.92] kvm[5029]: segfault at 0 ip 
004e3ef0 sp 7fff455d9fd0 error 4 in kvm[40+238000]
Mar 16 22:04:29 ursaminor kernel: [  603.405960] kvm[5862]: segfault at 0 ip 
004e3ef0 sp 7fff8d2c4810 error 4 in kvm[40+238000]
Mar 16 22:08:55 ursaminor kernel: [  869.664001] kvm[6347]: segfault at 0 ip 
004e3ef0 sp 7fffbd9a8000 error 4 in kvm[40+238000]
Mar 16 22:14:29 ursaminor kernel: [ 1203.397581] kvm[7016]: segfault at 0 ip 
004e3ef0 sp 7fffad92ac40 error 4 in kvm[40+238000]
Mar 16 22:14:44 ursaminor kernel: [ 1218.385540] kvm[7047]: segfault at 0 ip 
004e3ef0 sp 7fffb106e530 error 4 in kvm[40+238000]

My virtual machines doesn't start also.
In my /var/log/libvirt/qemu/mymachine.log i get this information:
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 
HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 16384 -smp 
4,sockets=4,cores=1,threads=1 -name win2008-STD-orion -uuid 
66a2dc8c-dd85-38da-ab66-405784525dce -nodefaults -chardev 
socket,id=monitor,path=/var/lib/libvirt/qemu/win2008-STD-orion.monitor,server,nowait
 -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive 
if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device 
ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive 
file=/home/images/win2k8_std_orion.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 
-device e1000,vlan=0,id=net0,mac=52:54:00:f5:78:57,bus=pci.0,addr=0x3 -net 
tap,fd=63,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device 
isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 
-k pl -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 char 
device redirected to /dev/pts/3 open /dev/kvm: Permission denied Could not 
initialize KVM, will disable KVM support 

Any one can help me please?

-- System Information:
Debian Release: 6.0.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libvirt0 depends on:
ii  libc6  2.11.3-4  Embedded GNU C Library: Shared lib
ii  libcap-ng0 0.6.4-1   An alternate posix capabilities li
ii  libgcrypt111.4.5-2   LGPL Crypto library - runtime libr
ii  libgnutls262.8.6-1+squeeze2  the GNU TLS library - runtime libr
ii  libnl1 1.1-6 library for dealing with netlink s
ii  libsasl2-2 2.1.23.dfsg1-7Cyrus SASL - authentication abstra
ii  libxenstore3.0 4.0.1-5.8 Xenstore communications library fo
ii  libxml22.7.8.dfsg-2+squeeze6 GNOME XML library

Versions of packages libvirt0 recommends:
ii  lvm2  2.02.66-5  The Linux Logical Volume Manager

libvirt0 suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org