All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "mnt: In detach_mounts detach the appropriate unmounted mount" has been added to the 4.1-stable tree
@ 2015-08-08 20:37 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-08-08 20:37 UTC (permalink / raw)
  To: ebiederm, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    mnt: In detach_mounts detach the appropriate unmounted mount

to the 4.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mnt-in-detach_mounts-detach-the-appropriate-unmounted-mount.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From fe78fcc85a2046c51f1535710996860557eeec20 Mon Sep 17 00:00:00 2001
From: "Eric W. Biederman" <ebiederm@xmission.com>
Date: Fri, 17 Jul 2015 14:54:27 -0500
Subject: mnt: In detach_mounts detach the appropriate unmounted mount

From: "Eric W. Biederman" <ebiederm@xmission.com>

commit fe78fcc85a2046c51f1535710996860557eeec20 upstream.

The handling of in detach_mounts of unmounted but connected mounts is
buggy and can lead to an infinite loop.

Correct the handling of unmounted mounts in detach_mount.  When the
mountpoint of an unmounted but connected mount is connected to a
dentry, and that dentry is deleted we need to disconnect that mount
from the parent mount and the deleted dentry.

Nothing changes for the unmounted and connected children.  They can be
safely ignored.

Fixes: ce07d891a0891d3c0d0c2d73d577490486b809e1 mnt: Honor MNT_LOCKED when detaching mounts
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/namespace.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1554,11 +1554,8 @@ void __detach_mounts(struct dentry *dent
 	while (!hlist_empty(&mp->m_list)) {
 		mnt = hlist_entry(mp->m_list.first, struct mount, mnt_mp_list);
 		if (mnt->mnt.mnt_flags & MNT_UMOUNT) {
-			struct mount *p, *tmp;
-			list_for_each_entry_safe(p, tmp, &mnt->mnt_mounts,  mnt_child) {
-				hlist_add_head(&p->mnt_umount.s_list, &unmounted);
-				umount_mnt(p);
-			}
+			hlist_add_head(&mnt->mnt_umount.s_list, &unmounted);
+			umount_mnt(mnt);
 		}
 		else umount_tree(mnt, UMOUNT_CONNECTED);
 	}


Patches currently in stable-queue which might be from ebiederm@xmission.com are

queue-4.1/mnt-clarify-and-correct-the-disconnect-logic-in-umount_tree.patch
queue-4.1/mnt-in-detach_mounts-detach-the-appropriate-unmounted-mount.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-08 20:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-08 20:37 Patch "mnt: In detach_mounts detach the appropriate unmounted mount" has been added to the 4.1-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.