Skip to contentSkip to conversation

fix slab corruption in namespace.c

PATCH New [email protected] 1 participant 1 message Apr 19, 2003 VFS

lore
Share & tools
lore
#0 lore raw

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
diff -u --recursive --new-file -X /linux/dontdiff a/fs/namespace.c b/fs/namespace.c
@@ -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;