[PATCH] namespace.c: fix mnt_namespace zeroing for expired mounts

From: Miklos Szeredi
Date: Wed May 25 2005 - 06:30:54 EST


This patch clears mnt_namespace in an expired mount.

If mnt_namespace is not cleared, it's possible to attach a new mount
to the already detached mount, because check_mnt() can return true.

The effect is a resource leak, since the resulting tree will never be
freed.

An earlier patch doing the same for regular umount has already been
applied (namespacec-fix-mnt_namespace-clearing.patch).

Signed-off-by: Miklos Szeredi <miklos@xxxxxxxxxx>

Index: linux/fs/namespace.c
===================================================================
--- linux.orig/fs/namespace.c 2005-05-22 11:52:56.000000000 +0200
+++ linux/fs/namespace.c 2005-05-22 11:52:59.000000000 +0200
@@ -843,6 +843,7 @@ static void expire_mount(struct vfsmount

/* delete from the namespace */
list_del_init(&mnt->mnt_list);
+ mnt->mnt_namespace = NULL;
detach_mnt(mnt, &old_nd);
spin_unlock(&vfsmount_lock);
path_release(&old_nd);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/