[PATCH] vfs: Fix dup_mnt_ns

From: Sasha Levin
Date: Wed Mar 14 2012 - 18:41:47 EST


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 <levinsasha928@xxxxxxxxx>
---
fs/namespace.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 5a6208b..224aff1 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);
--
1.7.8.4

--
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/