Compare commits

...

10 Commits
master ... f14

Author SHA1 Message Date
Peter Robinson 83ba258549 add ARM to NUMA platform exlcludes 2011-07-06 23:17:49 +01:00
Laine Stump 50fe0d263a update to 0.8.3-10
Fix for CVE-2011-2178, regression introduced in disk probe logic,
Bug 709775
2011-07-05 21:19:29 -04:00
Laine Stump 0c26bd4a4f Fix incorrect release version in specfile ChangeLog 2011-04-05 14:21:42 -04:00
Laine Stump 638904efc6 Fix for CVE-2011-1486, error reporting in libvirtd is not thread safe 2011-04-05 13:01:30 -04:00
Laine Stump 47e1b69fe8 Fix permissions of /var/lib/libvirt 2011-04-04 11:48:59 -04:00
Daniel Veillard a97e8a832b fix one crash in the the error handling for CVE-2011-1146 2011-03-16 17:00:53 +08:00
Daniel Veillard ad7d10defd Fix for CVE-2011-1146, missing checks on read-only connections 2011-03-15 09:09:39 +08:00
Daniel Veillard 944583a781 fix problem parsing octal addresses bug 653883 2011-03-04 20:59:32 +08:00
Jesse Keating b5384b6962 - Rebuilt for gcc bug 634757 2010-09-29 22:54:12 -07:00
Dan Horák e161c35538 - disable the nwfilterxml2xmltest also on s390(x) 2010-09-16 22:26:17 +02:00
7 changed files with 1522 additions and 7 deletions

View File

@ -0,0 +1,51 @@
From 452bf160e5bbe0789d706fda95f5919551eb2cac Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 25 Mar 2011 16:45:45 +0100
Subject: [PATCH 2/2] daemon: Avoid resetting errors before they are reported
https://bugzilla.redhat.com/show_bug.cgi?id=690733
Commit f44bfb7 was supposed to make sure no additional libvirt API (esp.
*Free) is called before remoteDispatchConnError() is called on error.
However, the patch missed two instances.
(cherry picked from commit 55cc591fc18e87b29febf78dc5b424b7c12f7349)
---
daemon/remote.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index a8258ca..7464957 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -4547,12 +4547,13 @@ remoteDispatchStoragePoolListVolumes (struct qemud_server *server ATTRIBUTE_UNUS
ret->names.names_len =
virStoragePoolListVolumes (pool,
ret->names.names_val, args->maxnames);
- virStoragePoolFree(pool);
if (ret->names.names_len == -1) {
VIR_FREE(ret->names.names_val);
remoteDispatchConnError(rerr, conn);
+ virStoragePoolFree(pool);
return -1;
}
+ virStoragePoolFree(pool);
return 0;
}
@@ -4576,11 +4577,12 @@ remoteDispatchStoragePoolNumOfVolumes (struct qemud_server *server ATTRIBUTE_UNU
}
ret->num = virStoragePoolNumOfVolumes (pool);
- virStoragePoolFree(pool);
if (ret->num == -1) {
remoteDispatchConnError(rerr, conn);
+ virStoragePoolFree(pool);
return -1;
}
+ virStoragePoolFree(pool);
return 0;
}
--
1.7.3.4

View File

@ -0,0 +1,44 @@
From f970d802ab805f1a37af384f148f34e108714034 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Wed, 3 Nov 2010 15:20:24 -0600
Subject: [PATCH] rpm: fix /var/lib/libvirt permissions
https://bugzilla.redhat.com/show_bug.cgi?id=649511
Regression of forcing 0700 permissions (which breaks guest startup
because the qemu user can't see /var/lib/libvirt/*.monitor) was
introduced in commit 66823690e, as part of libvirt 0.8.2.
* libvirt.spec.in (%files): Drop %{_localstatedir}/lib/libvirt,
since libvirt depends on libvirt-client.
(%files client): Guarantee 755 permissions on
%(_localstatedir}/lib/libvirt, since the qemu user must be able to
do pathname resolution to a subdirectory.
---
libvirt.spec.in | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 813e0c0..f77626e 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -793,7 +793,6 @@ fi
%dir %{_localstatedir}/run/libvirt/
-%dir %{_localstatedir}/lib/libvirt/
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
%dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/
@@ -883,7 +882,7 @@ fi
%{_sysconfdir}/rc.d/init.d/libvirt-guests
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
-%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt
+%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
%if %{with_sasl}
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
--
1.7.3.4

View File

@ -0,0 +1,53 @@
From 8efebd1761700a0cc32736829aead7807cc7865d Mon Sep 17 00:00:00 2001
From: =?utf8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@gmail.com>
Date: Tue, 26 Oct 2010 14:45:03 +0200
Subject: [PATCH] qemu: don't use %.3d format for bus/addr of USB devices
When using 0-prefixed numbers, QEmu will interpret them as octal numbers
(as C convention says); this means that if you attach a device that has
addr > 10 (decimal) you're going to attach a different device.
---
src/qemu/qemu_conf.c | 4 ++--
.../qemuxml2argv-hostdev-usb-address-device.args | 2 +-
.../qemuxml2argv-hostdev-usb-address.args | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 00e89a1..5bd3d4c 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -3266,7 +3266,7 @@ qemuBuildUSBHostdevDevStr(virDomainHostdevDefPtr dev)
return NULL;
}
- if (virAsprintf(&ret, "usb-host,hostbus=%.3d,hostaddr=%.3d,id=%s",
+ if (virAsprintf(&ret, "usb-host,hostbus=%d,hostaddr=%d,id=%s",
dev->source.subsys.u.usb.bus,
dev->source.subsys.u.usb.device,
dev->info.alias) < 0)
@@ -3288,7 +3288,7 @@ qemuBuildUSBHostdevUsbDevStr(virDomainHostdevDefPtr dev)
return NULL;
}
- if (virAsprintf(&ret, "host:%.3d.%.3d",
+ if (virAsprintf(&ret, "host:%d.%d",
dev->source.subsys.u.usb.bus,
dev->source.subsys.u.usb.device) < 0)
virReportOOMError();
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args
index 6900fd3..7e42542 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args
@@ -1 +1 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -usb -device usb-host,hostbus=014,hostaddr=006,id=hostdev0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -usb -device usb-host,hostbus=14,hostaddr=6,id=hostdev0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
index e57bec1..96e004d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
@@ -1 +1 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:014.006
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:14.6
--
1.7.3.4

View File

@ -0,0 +1,95 @@
From: Guido Günther <agx@sigxcpu.org>
Date: Mon, 14 Mar 2011 02:56:28 +0000 (+0800)
Subject: Add missing checks for read only connections
X-Git-Url: http://libvirt.org/git/?p=libvirt.git;a=commitdiff_plain;h=71753cb7f7a16ff800381c0b5ee4e99eea92fed3;hp=13c00dde3171b3a38d23cceb3f9151cb6cac3dad
Add missing checks for read only connections
As pointed on CVE-2011-1146, some API forgot to check the read-only
status of the connection for entry point which modify the state
of the system or may lead to a remote execution using user data.
The entry points concerned are:
- virConnectDomainXMLToNative
- virNodeDeviceDettach
- virNodeDeviceReAttach
- virNodeDeviceReset
- virDomainRevertToSnapshot
- virDomainSnapshotDelete
* src/libvirt.c: fix the above set of entry points to error on read-only
connections
Rebased to 0.8.2, mostly changed the call of the error routines
---
--- src/libvirt.c.orig 2011-03-14 17:03:45.000000000 +0800
+++ src/libvirt.c 2011-03-14 17:10:41.000000000 +0800
@@ -3190,6 +3190,10 @@ char *virConnectDomainXMLToNative(virCon
virDispatchError(NULL);
return (NULL);
}
+ if (conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(NULL, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
if (nativeFormat == NULL || domainXml == NULL) {
virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
@@ -9432,6 +9436,11 @@ virNodeDeviceDettach(virNodeDevicePtr de
return (-1);
}
+ if (dev->conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(dev->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+
if (dev->conn->driver->nodeDeviceDettach) {
int ret;
ret = dev->conn->driver->nodeDeviceDettach (dev);
@@ -9475,6 +9484,11 @@ virNodeDeviceReAttach(virNodeDevicePtr d
return (-1);
}
+ if (dev->conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(dev->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+
if (dev->conn->driver->nodeDeviceReAttach) {
int ret;
ret = dev->conn->driver->nodeDeviceReAttach (dev);
@@ -9520,6 +9534,11 @@ virNodeDeviceReset(virNodeDevicePtr dev)
return (-1);
}
+ if (dev->conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(dev->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+
if (dev->conn->driver->nodeDeviceReset) {
int ret;
ret = dev->conn->driver->nodeDeviceReset (dev);
@@ -12775,6 +12794,10 @@ virDomainRevertToSnapshot(virDomainSnaps
}
conn = snapshot->domain->conn;
+ if (conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
if (conn->driver->domainRevertToSnapshot) {
int ret = conn->driver->domainRevertToSnapshot(snapshot, flags);
@@ -12821,6 +12844,10 @@ virDomainSnapshotDelete(virDomainSnapsho
}
conn = snapshot->domain->conn;
+ if (conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
if (conn->driver->domainSnapshotDelete) {
int ret = conn->driver->domainSnapshotDelete(snapshot, flags);

View File

@ -0,0 +1,106 @@
From 584f9cee6926b57a19cc8bb36ea77124bdcfed94 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Fri, 24 Jun 2011 12:16:05 -0600
Subject: [PATCH] remote: protect against integer overflow
https://bugzilla.redhat.com/show_bug.cgi?id=717204
CVE-2011-2511 - integer overflow in VirDomainGetVcpus
Integer overflow and remote code are never a nice mix.
This has existed since commit 56cd414.
* src/libvirt.c (virDomainGetVcpus): Reject overflow up front.
* src/remote/remote_driver.c (remoteDomainGetVcpus): Avoid overflow
on sending rpc.
* daemon/remote.c (remoteDispatchDomainGetVcpus): Avoid overflow on
receiving rpc.
(cherry picked from commit 774b21c163845170c9ffa873f5720d318812eaf6)
Conflicts:
daemon/remote.c
src/remote/remote_driver.c
src/libvirt.c
Change to internal.h required to avoid backporting 89d994ad.
---
daemon/remote.c | 3 ++-
src/internal.h | 17 +++++++++++++++++
src/libvirt.c | 4 ++--
src/remote/remote_driver.c | 3 ++-
4 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 7464957..c6f7007 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1697,7 +1697,8 @@ remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
return -1;
}
- if (args->maxinfo * args->maplen > REMOTE_CPUMAPS_MAX) {
+ if (INT_MULTIPLY_OVERFLOW(args->maxinfo, args->maplen) ||
+ args->maxinfo * args->maplen > REMOTE_CPUMAPS_MAX) {
virDomainFree(dom);
remoteDispatchFormatError (rerr, "%s", _("maxinfo * maplen > REMOTE_CPUMAPS_MAX"));
return -1;
diff --git a/src/internal.h b/src/internal.h
index fab3e11..53447a9 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -226,4 +226,21 @@
} \
} while (0)
+/* branch-specific: we don't want to update gnulib on the branch, so this
+ * backports just one required macro from newer gnulib's intprops.h.
+ * This version requires that both a and b are 'int', rather than
+ * the fully type-generic version from gnulib. */
+# define INT_MULTIPLY_OVERFLOW(a, b) \
+ ((b) < 0 \
+ ? ((a) < 0 \
+ ? (a) < INT_MAX / (b) \
+ : (b) == -1 \
+ ? 0 \
+ : INT_MIN / (b) < (a)) \
+ : (b) == 0 \
+ ? 0 \
+ : ((a) < 0 \
+ ? (a) < INT_MIN / (b) \
+ : INT_MAX / (b) < (a)))
+
#endif /* __VIR_INTERNAL_H__ */
diff --git a/src/libvirt.c b/src/libvirt.c
index 1213ecf..6a584fb 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5218,8 +5218,8 @@ virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
/* Ensure that domainGetVcpus (aka remoteDomainGetVcpus) does not
try to memcpy anything into a NULL pointer. */
- if ((cpumaps == NULL && maplen != 0)
- || (cpumaps && maplen <= 0)) {
+ if (!cpumaps ? maplen != 0
+ : (maplen <= 0 || INT_MULTIPLY_OVERFLOW(maxinfo, maplen))) {
virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
goto error;
}
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index cb0d8e1..0d9b425 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -2467,7 +2467,8 @@ remoteDomainGetVcpus (virDomainPtr domain,
maxinfo, REMOTE_VCPUINFO_MAX);
goto done;
}
- if (maxinfo * maplen > REMOTE_CPUMAPS_MAX) {
+ if (INT_MULTIPLY_OVERFLOW(maxinfo, maplen) ||
+ maxinfo * maplen > REMOTE_CPUMAPS_MAX) {
remoteError(VIR_ERR_RPC,
_("vCPU map buffer length exceeds maximum: %d > %d"),
maxinfo * maplen, REMOTE_CPUMAPS_MAX);
--
1.7.3.4

File diff suppressed because it is too large Load Diff

View File

@ -77,8 +77,8 @@
%define with_xen 0
%endif
# Numactl is not available on s390[x]
%ifarch s390 s390x
# Numactl is not available on s390[x] or ARM
%ifarch s390 s390x %{arm}
%define with_numactl 0
%endif
@ -185,11 +185,20 @@
Summary: Library providing a simple API virtualization
Name: libvirt
Version: 0.8.3
Release: 2%{?dist}%{?extra_release}
Release: 11%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz
Patch1: %{name}-%{version}-boot-menu.patch
Patch2: %{name}-%{version}-octal-addresses.patch
Patch3: %{name}-%{version}-read-only-checks.patch
Patch4: %{name}-%{version}-fix-var-lib-libvirt-permissions.patch
# Patches 5, 6 CVE-2011-1486
Patch5: %{name}-%{version}-threadsafe-libvirtd-error-reporting.patch
Patch6: %{name}-%{version}-avoid-resetting-errors.patch
# Patch 7 CVE-2011-2511
Patch7: %{name}-%{version}-remote-protect-against-integer-overflow.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/
BuildRequires: python-devel
@ -426,6 +435,12 @@ of recent versions of Linux (and other OSes).
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p0
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%build
%if ! %{with_xen}
@ -665,8 +680,9 @@ do
printf "#!/bin/sh\nexit 0\n" > $i
chmod +x $i
done
# Temp hack till we figure out why its broken on ppc
%ifarch ppc
# Temp hack till we figure out why its broken on ppc and s390(x)
# a big endian issue?
%ifarch ppc s390 s390x
rm -f nwfilterxml2xmltest
printf "#!/bin/sh\nexit 0\n" > nwfilterxml2xmltest
chmod +x nwfilterxml2xmltest
@ -780,7 +796,6 @@ fi
%dir %{_localstatedir}/run/libvirt/
%dir %{_localstatedir}/lib/libvirt/
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
%dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/
@ -874,7 +889,7 @@ fi
%{_sysconfdir}/rc.d/init.d/libvirt-guests
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt
%if %{with_sasl}
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
@ -916,6 +931,39 @@ fi
%endif
%changelog
* Wed Jul 6 2011 Peter Robinson <pbrobinson@gmail.com> - 0.8.3-11
- add ARM to NUMA platform exlcludes
* Tue Jul 5 2011 Laine Stump <laine@redhat.com> 0.8.3-10
- Fix for CVE-2011-2511, integer overflow in VirDomainGetVcpus,
Bug 717204
* Tue Apr 5 2011 Laine Stump <laine@redhat.com> 0.8.3-9
- Fix incorrect release version in specfile ChangeLog
* Tue Apr 5 2011 Laine Stump <laine@redhat.com> 0.8.3-8
- Fix for CVE-2011-1486, error reporting in libvirtd is not thread safe,
bug 693457
* Mon Apr 4 2011 Laine Stump <laine@redhat.com> 0.8.3-7
- fix permissions on /var/lib/libvirt
* Wed Mar 16 2011 Daniel Veillard <veillard@redhat.com> 0.8.3-6
- fix one crash in the the error handling for previous patch
* Tue Mar 15 2011 Daniel Veillard <veillard@redhat.com> 0.8.3-5
- fix a lack of API check on read-only connections 683655
- CVE-2011-1146
* Fri Mar 4 2011 Daniel Veillard <veillard@redhat.com> 0.8.3-4
- fix problem parsing octal addresses bug 653883
* Wed Sep 29 2010 jkeating - 0.8.3-3.1
- Rebuilt for gcc bug 634757
* Thu Sep 16 2010 Dan Horák <dan[at]danny.cz> - 0.8.3-3
- disable the nwfilterxml2xmltest also on s390(x)
* Mon Aug 23 2010 Daniel P. Berrange <berrange@redhat.com> - 0.8.3-2
- Fix potential overflow in boot menu code