diff options
| author | Oleg Nesterov <[email protected]> | 2013-04-30 15:28:12 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2013-04-30 17:04:06 -0700 |
| commit | 6cd8f0acae3420afce37bf51a9ff8c2c20342af5 (patch) | |
| tree | 38478d4eb5b1c2d911c865c088a79edf2ebcea77 /scripts/stackusage | |
| parent | 403bad72b67d8b3f5a0240af5023adfa48132a65 (diff) | |
coredump: ensure that SIGKILL always kills the dumping thread
prepare_signal() blesses SIGKILL sent to the dumping process but this
signal can be "lost" anyway. The problems is, complete_signal() sees
SIGNAL_GROUP_EXIT and skips the "kill them all" logic. And even if the
dumping process is single-threaded (so the target is always "correct"),
the group-wide SIGKILL is not recorded in task->pending and thus
__fatal_signal_pending() won't be true. A multi-threaded case has even
more problems.
And even ignoring all technical details, SIGNAL_GROUP_EXIT doesn't look
right to me. This coredumping process is not exiting yet, it can do a lot
of work dumping the core.
With this patch the dumping process doesn't have SIGNAL_GROUP_EXIT, we set
signal->group_exit_task instead. This makes signal_group_exit() true and
thus this should equally close the races with exit/exec/stop but allows to
kill the dumping thread reliably.
Notes:
- It is not clear what should we do with ->group_exit_code
if the dumper was killed, see the next change.
- we need more (hopefully straightforward) changes to ensure
that SIGKILL actually interrupts the coredump. Basically we
need to check __fatal_signal_pending() in dump_write() and
dump_seek().
Signed-off-by: Oleg Nesterov <[email protected]>
Tested-by: Mandeep Singh Baines <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Neil Horman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Roland McGrath <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions