From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: "Eric W. Biederman" <ebiederm@xmission.com>, Jiri Slaby <jslaby@suse.cz>
Subject: [patch added to the 3.12 stable tree] mnt: Fix fs_fully_visible to verify the root directory is visible
Date: Fri, 15 May 2015 16:28:25 +0200 [thread overview]
Message-ID: <1431700109-10261-5-git-send-email-jslaby@suse.cz> (raw)
In-Reply-To: <1431700109-10261-1-git-send-email-jslaby@suse.cz>
From: "Eric W. Biederman" <ebiederm@xmission.com>
This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.
===============
commit 7e96c1b0e0f495c5a7450dc4aa7c9a24ba4305bd upstream.
This fixes a dumb bug in fs_fully_visible that allows proc or sys to
be mounted if there is a bind mount of part of /proc/ or /sys/ visible.
Reported-by: Eric Windisch <ewindisch@docker.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/namespace.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/namespace.c b/fs/namespace.c
index 7c3c0f6d2744..247f34d43dda 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2940,6 +2940,12 @@ bool fs_fully_visible(struct file_system_type *type)
if (mnt->mnt.mnt_sb->s_type != type)
continue;
+ /* This mount is not fully visible if it's root directory
+ * is not the root directory of the filesystem.
+ */
+ if (mnt->mnt.mnt_root != mnt->mnt.mnt_sb->s_root)
+ continue;
+
/* This mount is not fully visible if there are any child mounts
* that cover anything except for empty directories.
*/
--
2.3.7
next prev parent reply other threads:[~2015-05-15 14:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 14:28 [patch added to the 3.12 stable tree] ocfs2: dlm: fix race between purge and get lock resource Jiri Slaby
2015-05-15 14:28 ` [patch added to the 3.12 stable tree] nilfs2: fix sanity check of btree level in nilfs_btree_root_broken() Jiri Slaby
2015-05-15 14:28 ` [patch added to the 3.12 stable tree] RDMA/CMA: Canonize IPv4 on IPV6 sockets properly Jiri Slaby
2015-05-15 14:28 ` [patch added to the 3.12 stable tree] gpio: sysfs: fix memory leaks and device hotplug Jiri Slaby
2015-05-15 14:51 ` Johan Hovold
2015-05-15 19:51 ` Jiri Slaby
2015-05-15 20:24 ` Johan Hovold
2015-05-16 6:42 ` Jiri Slaby
2015-05-15 14:28 ` Jiri Slaby [this message]
2015-05-15 14:28 ` [patch added to the 3.12 stable tree] mm/memory-failure: call shake_page() when error hits thp tail page Jiri Slaby
2015-05-15 14:28 ` [patch added to the 3.12 stable tree] writeback: use |1 instead of +1 to protect against div by zero Jiri Slaby
2015-05-15 14:28 ` [patch added to the 3.12 stable tree] mm: soft-offline: fix num_poisoned_pages counting on concurrent events Jiri Slaby
2015-05-15 14:28 ` [patch added to the 3.12 stable tree] xen/console: Update console event channel on resume Jiri Slaby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431700109-10261-5-git-send-email-jslaby@suse.cz \
--to=jslaby@suse.cz \
--cc=ebiederm@xmission.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox