diff options
| author | Richard Weinberger <[email protected]> | 2013-08-18 11:30:08 +0000 |
|---|---|---|
| committer | Richard Weinberger <[email protected]> | 2013-09-07 08:56:58 +0000 |
| commit | 91d44ff860a9e9c0db81a89cbc24fa31fbd8e6d3 (patch) | |
| tree | bb14601ab3afbcec3cb8d7d0f207d09cfc792268 /arch/um/os-Linux/util.c | |
| parent | um: ubd: Introduce submit_request() (diff) | |
| download | kernel-91d44ff860a9e9c0db81a89cbc24fa31fbd8e6d3.tar.gz kernel-91d44ff860a9e9c0db81a89cbc24fa31fbd8e6d3.zip | |
um: Cleanup SIGTERM handling
Richard reported that some UML processes survive if the UML
main process receives a SIGTERM.
This issue was caused by a wrongly placed signal(SIGTERM, SIG_DFL)
in init_new_thread_signals().
It disabled the UML exit handler accidently for some processes.
The correct solution is to disable the fatal handler for all
UML helper threads/processes.
Such that last_ditch_exit() does not get called multiple times
and all processes can exit due to SIGTERM.
Reported-and-tested-by: Richard W.M. Jones <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
Diffstat (limited to 'arch/um/os-Linux/util.c')
| -rw-r--r-- | arch/um/os-Linux/util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c index 492ef5e6e166..faee55ef6d2f 100644 --- a/arch/um/os-Linux/util.c +++ b/arch/um/os-Linux/util.c @@ -94,6 +94,16 @@ static inline void __attribute__ ((noreturn)) uml_abort(void) exit(127); } +/* + * UML helper threads must not handle SIGWINCH/INT/TERM + */ +void os_fix_helper_signals(void) +{ + signal(SIGWINCH, SIG_IGN); + signal(SIGINT, SIG_DFL); + signal(SIGTERM, SIG_DFL); +} + void os_dump_core(void) { int pid; |
