diff options
author | Richard Weinberger <richard@nod.at> | 2013-05-17 14:21:01 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2013-07-19 10:45:18 +0200 |
commit | 0974a9cadc7886f7baaa458bb0c89f5c5f9d458e (patch) | |
tree | daf5e00929c889654b8eb8974b9e42ca77deea70 /arch/um | |
parent | dee20035b42d569984d2c16041b51e4d75e233b5 (diff) | |
download | linux-0974a9cadc7886f7baaa458bb0c89f5c5f9d458e.tar.bz2 |
um: Fix wait_stub_done() error handling
If we die within a stub handler we only way to reliable
kill the (obviously) dying uml guest process is killing
it's host twin on the host side.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 4625949bf1e4..441e4ba074f4 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -54,7 +54,7 @@ static int ptrace_dump_regs(int pid) void wait_stub_done(int pid) { - int n, status, err; + int n, status, err, bad_stop = 0; while (1) { CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); @@ -74,6 +74,8 @@ void wait_stub_done(int pid) if (((1 << WSTOPSIG(status)) & STUB_DONE_MASK) != 0) return; + else + bad_stop = 1; bad_wait: err = ptrace_dump_regs(pid); @@ -83,7 +85,10 @@ bad_wait: printk(UM_KERN_ERR "wait_stub_done : failed to wait for SIGTRAP, " "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, status); - fatal_sigsegv(); + if (bad_stop) + kill(pid, SIGKILL); + else + fatal_sigsegv(); } extern unsigned long current_stub_stack(void); |