]> git.proxmox.com Git - lxc.git/commitdiff
patch: conf: set pty_info to NULL after free
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 29 Jul 2016 09:58:01 +0000 (11:58 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 5 Aug 2016 09:06:55 +0000 (11:06 +0200)
This is upstream and will be in the next release.

debian/patches/0001-conf-set-pty_info-to-NULL-after-free.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0001-conf-set-pty_info-to-NULL-after-free.patch b/debian/patches/0001-conf-set-pty_info-to-NULL-after-free.patch
new file mode 100644 (file)
index 0000000..795ad9c
--- /dev/null
@@ -0,0 +1,30 @@
+From e00c024230e457a0f37ea5c90bd8caac0c30020e Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Date: Thu, 28 Jul 2016 11:52:18 +0200
+Subject: [PATCH] conf: set pty_info to NULL after free
+
+This fixes a double free corruption on container-requested
+reboots when lxc_spawn() fails before receiving the ttys, as
+lxc_fini() (part of __lxc_start()'s cleanup) calls
+lxc_delete_tty().
+
+Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
+---
+ src/lxc/conf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index 48a2978..1e330ac 100644
+--- a/src/lxc/conf.c
++++ b/src/lxc/conf.c
+@@ -3327,6 +3327,7 @@ void lxc_delete_tty(struct lxc_tty_info *tty_info)
+       }
+       free(tty_info->pty_info);
++      tty_info->pty_info = NULL;
+       tty_info->nbtty = 0;
+ }
+-- 
+2.1.4
+
index 3737812ffb87bf81b096e7652829dd6e643e884d..72bfbb49415413448becf78c4772b860f5f89bb5 100644 (file)
@@ -6,3 +6,4 @@ include-linux-sched.patch
 use-var-lib-vz-as-default-dir.patch
 #do-not-use-config-path-for-rootfs.patch
 run-lxcnetaddbr.patch
+0001-conf-set-pty_info-to-NULL-after-free.patch