linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix copy_namespace()
@ 2003-08-25 14:29 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2003-08-25 14:29 UTC (permalink / raw)
  To: marcelo; +Cc: linux-kernel

Originally by aeb, in 2.5 for ages.

Fix far too small kmalloc in copy_namespace and promote errors properly.


--- linux/fs/namespace.c	2003-06-13 22:07:33.000000000 +0200
+++ linux/fs/namespace.c	2003-06-18 02:48:47.000000000 +0200
@@ -763,7 +763,7 @@ int copy_namespace(int flags, struct tas
 		return -EPERM;
 	}
 
-	new_ns = kmalloc(sizeof(struct namespace *), GFP_KERNEL);
+	new_ns = kmalloc(sizeof(struct namespace), GFP_KERNEL);
 	if (!new_ns)
 		goto out;
 
--- linux/kernel/fork.c	2003-06-18 02:36:34.000000000 +0200
+++ linux/kernel/fork.c	2003-06-18 02:49:22.000000000 +0200
@@ -793,7 +793,8 @@ int do_fork(unsigned long clone_flags, u
 		goto bad_fork_cleanup_fs;
 	if (copy_mm(clone_flags, p))
 		goto bad_fork_cleanup_sighand;
-	if (copy_namespace(clone_flags, p))
+	retval = copy_namespace(clone_flags, p);
+	if (retval)
 		goto bad_fork_cleanup_mm;
 	retval = copy_thread(0, clone_flags, stack_start, stack_size, p, regs);
 	if (retval)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-25 14:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-25 14:29 [PATCH] fix copy_namespace() Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).