From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:21967 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932571AbbFHNnE (ORCPT ); Mon, 8 Jun 2015 09:43:04 -0400 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: sasha.levin@oracle.com Subject: [PATCH 3.18 007/178] mnt: Fix fs_fully_visible to verify the root directory is visible Date: Mon, 8 Jun 2015 09:39:58 -0400 Message-Id: <1433770969-2003-8-git-send-email-sasha.levin@oracle.com> In-Reply-To: <1433770969-2003-1-git-send-email-sasha.levin@oracle.com> References: <1433770969-2003-1-git-send-email-sasha.levin@oracle.com> Sender: stable-owner@vger.kernel.org List-ID: From: "Eric W. Biederman" [ Upstream commit 7e96c1b0e0f495c5a7450dc4aa7c9a24ba4305bd ] 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. Cc: stable@vger.kernel.org Reported-by: Eric Windisch Signed-off-by: "Eric W. Biederman" Signed-off-by: Sasha Levin --- fs/namespace.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/namespace.c b/fs/namespace.c index 07ba424..64837e3 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -3137,6 +3137,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.1.0