fix slab corruption in namespace.c
PATCH 1/1 fix slab corruption in namespace.c
The
new_ns = kmalloc(sizeof(struct namespace *), GFP_KERNEL);
was less fortunate.
Andries
----------------------------------------------------------------
fs/namespace.c +3 -3
@@ -52,7 +52,7 @@INIT_LIST_HEAD (&mnt->mnt_list);if (name) {int size =strlen (name)+1 ; -char * newname =kmalloc (size,GFP_KERNEL ); +char *newname =kmalloc (size,GFP_KERNEL );if (newname) {memcpy (newname, name, size); mnt->mnt_devname = newname;
@@ -774,7 +774,7 @@get_namespace (namespace); -if (! (flags &CLONE_NEWNS )) +if (!(flags &CLONE_NEWNS ))return 0 ;if (!capable (CAP_SYS_ADMIN )) {
@@ -782,7 +782,7 @@return -EPERM ; } - new_ns =kmalloc (sizeof (struct namespace *),GFP_KERNEL ); + new_ns =kmalloc (sizeof (struct namespace ),GFP_KERNEL );if (!new_ns) goto out;