From a67d500eda85fcfde0f73f82b2416d8130f1b9f6 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Wed, 21 Mar 2012 10:48:19 +1100 Subject: [PATCH] vfs: fix dup_mnt_ns Commit f8b88187 ("brlocks/lglocks: cleanups") has accidently dropped the assignment of the new root into the mnt_fs. This leads to NULL dereferences since ->root is assumed to be always non-NULL. Signed-off-by: Sasha Levin Cc: Andi Kleen Cc: Al Viro Cc: Rusty Russell Signed-off-by: Andrew Morton --- fs/namespace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/namespace.c b/fs/namespace.c index 5a6208b2daa9..224aff1c0dfd 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2250,6 +2250,7 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns, kfree(new_ns); return ERR_PTR(-ENOMEM); } + new_ns->root = new; br_write_lock(&vfsmount_lock); list_add_tail(&new_ns->list, &new->mnt_list); br_write_unlock(&vfsmount_lock); -- 2.39.2