File c364897-CVE-2013-6456.patch of Package libvirt.openSUSE_13.1_Update

From e2a0b1a6b4f1c2f25957cc81ba93a13f247b9221 Mon Sep 17 00:00:00 2001
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Tue, 4 Feb 2014 16:43:18 +0000
Subject: [PATCH 02/14] Fix path used for USB device attach with LXC

The LXC code missed the 'usb' component out of the path
/dev/bus/usb/$BUSNUM/$DEVNUM, so it failed to actually
setup cgroups for the device. This was in fact lucky
because the call to virLXCSetupHostUsbDeviceCgroup
was also mistakenly passing '&priv->cgroup' instead of
just 'priv->cgroup'. So once the path is fixed, libvirtd
would then crash trying to access the bogus virCgroupPtr
pointer. This would have been a security issue, were it
not for the bogus path preventing the pointer reference
being reached.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit c3648972222d4eb056e6e667c193ba56a7aa3557)
---
 src/lxc/lxc_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: libvirt-1.1.2/src/lxc/lxc_driver.c
===================================================================
--- libvirt-1.1.2.orig/src/lxc/lxc_driver.c
+++ libvirt-1.1.2/src/lxc/lxc_driver.c
@@ -3334,7 +3334,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLiv
                     (unsigned long long)priv->initpid) < 0)
         goto cleanup;
 
-    if (virAsprintf(&dstdir, "%s/dev/bus/%03d",
+    if (virAsprintf(&dstdir, "%s/dev/bus/usb/%03d",
                     vroot,
                     def->source.subsys.u.usb.bus) < 0)
         goto cleanup;
@@ -3399,7 +3399,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLiv
 
     if (virUSBDeviceFileIterate(usb,
                                 virLXCSetupHostUsbDeviceCgroup,
-                                &priv->cgroup) < 0)
+                                priv->cgroup) < 0)
         goto cleanup;
 
     ret = 0;
openSUSE Build Service is sponsored by