5674459f46
- CVE-2013-2230: Fix crash when multiple event callbacks were registered f38c8185-CVE-2013-2230.patch bnc#827801 - Update to libvirt 1.1.0 - Extensible migration APIs - Add a policy kit access control driver - various improvements in the Xen and libxl drivers - improve networking support on BSD - agent based vCPU hotplug support - Many incremental improvements and bug fixes, see http://libvirt.org/news.html - Drop upstream patches: 244e0b8c-CVE-2013-2218.patch OBS-URL: https://build.opensuse.org/request/show/182783 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=282
91 lines
2.7 KiB
Diff
91 lines
2.7 KiB
Diff
Index: src/lxc/lxc_container.c
|
|
===================================================================
|
|
--- src/lxc/lxc_container.c.orig
|
|
+++ src/lxc/lxc_container.c
|
|
@@ -142,6 +142,7 @@ int lxcContainerHasReboot(void)
|
|
int cmd, v;
|
|
int status;
|
|
char *tmp;
|
|
+ int stacksize = getpagesize() * 4;
|
|
|
|
if (virFileReadAll("/proc/sys/kernel/ctrl-alt-del", 10, &buf) < 0)
|
|
return -1;
|
|
@@ -158,14 +159,21 @@ int lxcContainerHasReboot(void)
|
|
VIR_FREE(buf);
|
|
cmd = v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF;
|
|
|
|
- if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
|
|
+#ifdef __ia64__
|
|
+ stacksize *= 2;
|
|
+#endif
|
|
+ if (VIR_ALLOC_N(stack, stacksize) < 0) {
|
|
virReportOOMError();
|
|
return -1;
|
|
}
|
|
|
|
- childStack = stack + (getpagesize() * 4);
|
|
+ childStack = stack + stacksize;
|
|
|
|
+#ifdef __ia64__
|
|
+ cpid = __clone2(lxcContainerRebootChild, stack, stacksize, flags, &cmd);
|
|
+#else
|
|
cpid = clone(lxcContainerRebootChild, childStack, flags, &cmd);
|
|
+#endif
|
|
VIR_FREE(stack);
|
|
if (cpid < 0) {
|
|
virReportSystemError(errno, "%s",
|
|
@@ -2097,6 +2105,9 @@ int lxcContainerStart(virDomainDefPtr de
|
|
ttyPaths, nttyPaths, handshakefd};
|
|
|
|
/* allocate a stack for the container */
|
|
+#ifdef __ia64__
|
|
+ stacksize *= 2;
|
|
+#endif
|
|
if (VIR_ALLOC_N(stack, stacksize) < 0) {
|
|
virReportOOMError();
|
|
return -1;
|
|
@@ -2115,7 +2126,11 @@ int lxcContainerStart(virDomainDefPtr de
|
|
cflags |= CLONE_NEWNET;
|
|
}
|
|
|
|
+#ifdef __ia64__
|
|
+ pid = __clone2(lxcContainerChild, stack, stacksize, cflags, &args);
|
|
+#else
|
|
pid = clone(lxcContainerChild, stacktop, cflags, &args);
|
|
+#endif
|
|
VIR_FREE(stack);
|
|
VIR_DEBUG("clone() completed, new container PID is %d", pid);
|
|
|
|
@@ -2141,6 +2156,7 @@ int lxcContainerAvailable(int features)
|
|
int cpid;
|
|
char *childStack;
|
|
char *stack;
|
|
+ int stacksize = getpagesize() * 4;
|
|
|
|
if (features & LXC_CONTAINER_FEATURE_USER)
|
|
flags |= CLONE_NEWUSER;
|
|
@@ -2148,14 +2164,21 @@ int lxcContainerAvailable(int features)
|
|
if (features & LXC_CONTAINER_FEATURE_NET)
|
|
flags |= CLONE_NEWNET;
|
|
|
|
- if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
|
|
+#ifdef __ia64__
|
|
+ stacksize *= 2;
|
|
+#endif
|
|
+ if (VIR_ALLOC_N(stack, stacksize) < 0) {
|
|
VIR_DEBUG("Unable to allocate stack");
|
|
return -1;
|
|
}
|
|
|
|
- childStack = stack + (getpagesize() * 4);
|
|
+ childStack = stack + stacksize;
|
|
|
|
+#ifdef __ia64__
|
|
+ cpid = __clone2(lxcContainerDummyChild, stack, stacksize, flags, NULL);
|
|
+#else
|
|
cpid = clone(lxcContainerDummyChild, childStack, flags, NULL);
|
|
+#endif
|
|
VIR_FREE(stack);
|
|
if (cpid < 0) {
|
|
char ebuf[1024] ATTRIBUTE_UNUSED;
|