[kernel] r19245 - in dists/squeeze/linux-2.6/debian: . patches/features/all/openvz patches/series
Ben Hutchings
benh at alioth.debian.org
Wed Jul 11 04:12:44 UTC 2012
Author: benh
Date: Wed Jul 11 04:12:41 2012
New Revision: 19245
Log:
[openvz] proc: Fix extreme memory use for /proc/self/mountinfo in container
Thanks to Andrew Vagin, Christoph Lechleitner (Closes: #655385)
Added:
dists/squeeze/linux-2.6/debian/patches/features/all/openvz/proc-self-mountinfo.patch
Modified:
dists/squeeze/linux-2.6/debian/changelog
dists/squeeze/linux-2.6/debian/patches/series/44-extra
Modified: dists/squeeze/linux-2.6/debian/changelog
==============================================================================
--- dists/squeeze/linux-2.6/debian/changelog Mon Jul 9 13:49:39 2012 (r19244)
+++ dists/squeeze/linux-2.6/debian/changelog Wed Jul 11 04:12:41 2012 (r19245)
@@ -7,6 +7,8 @@
* linux-image: Relax version dependency on linux-base, to simplify
testing of bug fixes
* [x86] linux-image: Fix minimum version of lilo (Closes: #680467)
+ * [openvz] proc: Fix extreme memory use for /proc/self/mountinfo in
+ container, thanks to Andrew Vagin, Christoph Lechleitner (Closes: #655385)
[ Jonathan Nieder ]
* ath5k: initialize default noise floor
Added: dists/squeeze/linux-2.6/debian/patches/features/all/openvz/proc-self-mountinfo.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/features/all/openvz/proc-self-mountinfo.patch Wed Jul 11 04:12:41 2012 (r19245)
@@ -0,0 +1,36 @@
+Subject: proc: Fix extreme memory use for /proc/self/mountinfo in container
+Bug: http://bugzilla.openvz.org/show_bug.cgi?id=2142
+Bug-Debian: http://bugs.debian.org/655385
+
+Extracted from OpenVZ RHEL 6 package by Andrew Vagin in
+http://forum.openvz.org/index.php?t=msg&th=10493#msg_45496
+
+Explanation by Ben Hutchings <ben at decadent.org.uk>:
+
+seq_file output functions generally call seq_commit() with their
+return value. If this is negative, usually because there is
+insufficient space in the output buffer, it causes the buffer to be
+marked as full. If the seq_file show() operation then goes on to
+return 0, the seq_file read loop (traverse() in seq_file.c) will
+detect the full buffer and retry with a larger buffer.
+
+Under OpenVZ, seq_path_root() may also fail because __d_path()
+determines that the mountpoint is not visible in the current
+container, and show_mountinfo() will still return 0. The read loop
+will repeatedly increase the buffer size until allocation fails.
+Instead, show_mountinfo() should hide the mountpoint by returning
+SEQ_SKIP.
+
+--- a/fs/namespace.c
++++ b/fs/namespace.c
+@@ -873,8 +873,8 @@
+ MAJOR(sb->s_dev), MINOR(sb->s_dev));
+ seq_dentry(m, mnt->mnt_root, " \t\n\\");
+ seq_putc(m, ' ');
+- seq_path_root(m, &mnt_path, &root, " \t\n\\");
+- if (root.mnt != p->root.mnt || root.dentry != p->root.dentry) {
++ err = seq_path_root(m, &mnt_path, &root, " \t\n\\");
++ if (root.mnt != p->root.mnt || root.dentry != p->root.dentry || err == -EINVAL) {
+ /*
+ * Mountpoint is outside root, discard that one. Ugly,
+ * but less so than trying to do that in iterator in a
Modified: dists/squeeze/linux-2.6/debian/patches/series/44-extra
==============================================================================
--- dists/squeeze/linux-2.6/debian/patches/series/44-extra Mon Jul 9 13:49:39 2012 (r19244)
+++ dists/squeeze/linux-2.6/debian/patches/series/44-extra Wed Jul 11 04:12:41 2012 (r19245)
@@ -9,6 +9,7 @@
+ features/all/openvz/0005-ve-Fix-d_path-return-code-when-no-buffer-given.patch featureset=openvz
+ features/all/openvz/ptrace_dont_allow_process_without_memory_map_v2.patch featureset=openvz
+ features/all/openvz/cpt-Allow-ext4-mount.patch featureset=openvz
++ features/all/openvz/proc-self-mountinfo.patch featureset=openvz
+ features/all/vserver/revert-fix-cputime-overflow-in-uptime_proc_show.patch featureset=vserver
+ features/all/vserver/vs2.3.0.36.29.8.patch featureset=vserver
More information about the Kernel-svn-changes
mailing list