public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] UML: Use PTRACE_KILL instead of SIGKILL to kill host-OS processes
@ 2004-11-03 11:37 Chris Wedgwood
  2004-11-03 11:47 ` Anton Altaparmakov
       [not found] ` <200411040113.27747.blaisorblade_spam@yahoo.it>
  0 siblings, 2 replies; 15+ messages in thread
From: Chris Wedgwood @ 2004-11-03 11:37 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Blaisorblade, user-mode-linux-devel, Andrew Morton, LKML

kill(..., SIGKILL) doesn't work to kill host-OS processes created in
the exec path in TT mode --- for this we need PTRACE_KILL (it did work
in previous kernels, but not by design).  Without this process will
accumulate on the host-OS (although the won't be visible inside UML).

Signed-off-by: Chris Wedgwood <cw@f00f.org>
---

Yes, there are other fixes along these lines which are needed but one
at a time as we test these...

Index: cw-current/arch/um/kernel/tt/exec_user.c
===================================================================
--- cw-current.orig/arch/um/kernel/tt/exec_user.c	2004-11-03 02:10:18.064830204 -0800
+++ cw-current/arch/um/kernel/tt/exec_user.c	2004-11-03 02:12:10.447716745 -0800
@@ -35,7 +35,8 @@
 		tracer_panic("do_exec failed to get registers - errno = %d",
 			     errno);
 
-	kill(old_pid, SIGKILL);
+	if (ptrace(PTRACE_KILL, old_pid, NULL, NULL))
+		printk("Warning: ptrace(PTRACE_KILL, %d, ...) saw %d\n", errno);
 
 	if(ptrace_setregs(new_pid, regs) < 0)
 		tracer_panic("do_exec failed to start new proc - errno = %d",

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-11-12  0:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-03 11:37 [PATCH] UML: Use PTRACE_KILL instead of SIGKILL to kill host-OS processes Chris Wedgwood
2004-11-03 11:47 ` Anton Altaparmakov
2004-11-03 12:08   ` [PATCH] UML: Use PTRACE_KILL instead of SIGKILL to kill host-OS processes (take #2) Chris Wedgwood
2004-11-03 19:28     ` [uml-devel] " Blaisorblade
2004-11-03 20:09       ` Chris Wedgwood
2004-11-03 22:51         ` Blaisorblade
2004-11-03 20:18       ` Gerd Knorr
2004-11-03 20:48         ` Chris Wedgwood
2004-11-04  0:23           ` Blaisorblade
2004-11-03 23:19         ` Blaisorblade
     [not found] ` <200411040113.27747.blaisorblade_spam@yahoo.it>
     [not found]   ` <20041104003943.GB17467@taniwha.stupidest.org>
2004-11-04  4:31     ` Fixing UML against NPTL (was: Re: [uml-devel] [PATCH] UML: Use PTRACE_KILL instead of SIGKILL to kill host-OS processes (take #2)) Blaisorblade
2004-11-11 17:45       ` Daniel Jacobowitz
2004-11-11 18:31         ` Christophe Saout
2004-11-11 18:45           ` Daniel Jacobowitz
2004-11-12  0:09             ` Blaisorblade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox