Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753922AbcDVLGn (ORCPT ); Fri, 22 Apr 2016 07:06:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:43999 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753858AbcDVLGi (ORCPT ); Fri, 22 Apr 2016 07:06:38 -0400 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Eric W. Biederman" , Jiri Slaby Subject: [PATCH 3.12 73/78] mnt: Move the clear of MNT_LOCKED from copy_tree to it's callers. Date: Fri, 22 Apr 2016 13:05:56 +0200 Message-Id: X-Mailer: git-send-email 2.8.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1669 Lines: 52 From: "Eric W. Biederman" 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 8486a7882b5ba906992fd78bbfcefaae7fe285cc upstream. Clear MNT_LOCKED in the callers of copy_tree except copy_mnt_ns, and collect_mounts. In copy_mnt_ns it is necessary to create an exact copy of a mount tree, so not clearing MNT_LOCKED is important. Similarly collect_mounts is used to take a snapshot of the mount tree for audit logging purposes and auditing using a faithful copy of the tree is important. This becomes particularly significant when we start setting MNT_LOCKED on rootfs to prevent it from being unmounted. Signed-off-by: "Eric W. Biederman" Acked-by: NeilBrown Signed-off-by: Jiri Slaby --- fs/namespace.c | 1 - fs/pnode.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index d727b0ce11df..f67473272010 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1416,7 +1416,6 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry, if (IS_ERR(q)) return q; - q->mnt.mnt_flags &= ~MNT_LOCKED; q->mnt_mountpoint = mnt->mnt_mountpoint; p = mnt; diff --git a/fs/pnode.c b/fs/pnode.c index 9af0df15256e..509d046e2b3e 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -249,6 +249,7 @@ int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp, list_splice(tree_list, tmp_list.prev); goto out; } + child->mnt.mnt_flags &= ~MNT_LOCKED; if (is_subdir(dest_mp->m_dentry, m->mnt.mnt_root)) { mnt_set_mountpoint(m, dest_mp, child); -- 2.8.1