Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933065AbcCIPSu (ORCPT ); Wed, 9 Mar 2016 10:18:50 -0500 Received: from mail-oi0-f41.google.com ([209.85.218.41]:33590 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932906AbcCIPSR (ORCPT ); Wed, 9 Mar 2016 10:18:17 -0500 From: Seth Forshee To: "Eric W. Biederman" , Alexander Viro Cc: "Serge E. Hallyn" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Seth Forshee Subject: [PATCH 1/2] fs: Allow bind mounts with locked children on permaenetly empty directories Date: Wed, 9 Mar 2016 09:18:06 -0600 Message-Id: <1457536687-32794-2-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457536687-32794-1-git-send-email-seth.forshee@canonical.com> References: <1457536687-32794-1-git-send-email-seth.forshee@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 851 Lines: 26 Forbidding a bind mount due to a locked child on a permanently empty directory provides no security benefit since the directory cannot contain any contents which have been overmounted for security reasons. Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Seth Forshee --- fs/namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/namespace.c b/fs/namespace.c index 4fb1691b4355..930f5557b1d1 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2065,6 +2065,8 @@ static bool has_locked_children(struct mount *mnt, struct dentry *dentry) list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) { if (!is_subdir(child->mnt_mountpoint, dentry)) continue; + if (is_empty_dir_inode(child->mnt_mountpoint->d_inode)) + continue; if (child->mnt.mnt_flags & MNT_LOCKED) return true; -- 1.9.1