lkml.org 
[lkml]   [2001]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] handling of failed copy_thread() in do_fork()
	If copy_thread() fails (it can't happen on x86, but on other
architectures, e.g. on sparc, it's possible) do_fork() doesn't do
full cleanup - it forgets to do exit_mm(). Obvious fix follows.
Please, apply.
Al

diff -urN S4-pre7/kernel/fork.c S4-pre7-fork/kernel/fork.c
--- S4-pre7/kernel/fork.c Wed Apr 25 20:43:12 2001
+++ S4-pre7-fork/kernel/fork.c Wed Apr 25 22:12:39 2001
@@ -652,7 +652,7 @@
goto bad_fork_cleanup_sighand;
retval = copy_thread(0, clone_flags, stack_start, stack_size, p, regs);
if (retval)
- goto bad_fork_cleanup_sighand;
+ goto bad_fork_cleanup_mm;
p->semundo = NULL;

/* Our parent execution domain becomes current domain
@@ -708,6 +708,8 @@
down(&sem);
return retval;

+bad_fork_cleanup_mm:
+ exit_mm(p);
bad_fork_cleanup_sighand:
exit_sighand(p);
bad_fork_cleanup_fs:
-
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 12:52    [W:0.022 / U:0.136 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site