lkml.org 
[lkml]   [2003]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix copy_namespace()
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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.027 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site