Skip to content

Short circuit delivery for coredump signals

Eric W. Biederman lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 21 repliesIn review
  2. v111 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14signal: Generalize posixtimer_queue_sigqueue into enqueue_signalkernel/signal.c+18 -193 replies
2/14signal: Factor out sig_blocked from sig_ignoredkernel/signal.c+20 -11 reply
3/14signal: More accurate ignoring of signals based on sig_can_short_circuitkernel/signal.c+44 -151 reply
4/14signal: Use sig_can_short_circuit to improve fatal signal deliverykernel/signal.c+27 -311 reply
5/14signal: Compute the exit_code in get_signalkernel/exit.c kernel/signal.c+10 -61 reply
5/14signal: Compute the exit_code in get_signalkernel/exit.c kernel/signal.c+10 -60 replies
6/14signal: In get_signal call do_exit when it is unnecessary to shoot down threadskernel/exit.c kernel/signal.c+6 -51 reply
7/14signal: Bring down all threads when handling a non-coredump fatal signalkernel/signal.c+15 -11 reply
8/14signal: Move stopping for the coredump from do_exit into get_signalfs/coredump.c include/linux/coredump.h kernel/exit.c +2 more+39 -301 reply
9/14signal: Move audit_core_dumps from do_coredump into get_signalfs/coredump.c kernel/signal.c+1 -21 reply
10/14coredump: In zap_threads complete startup if there is no need to waitfs/coredump.c+15 -151 reply
11/14signal: Use the thread killing in get_signal for coredumpsfs/coredump.c include/linux/coredump.h include/linux/sched/signal.h +1 more+64 -891 reply
12/14exit: Make do_group_exit staticinclude/linux/sched/task.h kernel/exit.c+1 -21 reply
13/14signal: Dequeue fatal signalsinclude/linux/sched/signal.h kernel/signal.c+36 -81 reply
14/14signal: Short circuit deliver coredump signalskernel/signal.c+1 -21 reply

Reviews trailers per patch

13 of 15 patches have a Reviewed-by or Acked-by.

PatchBradley Morgan
1/14R-b
2/14R-b
3/14R-b
4/14R-b
5/14R-b
5/14R-b
6/14R-b
7/14R-b
8/14
9/14R-b
10/14R-b
11/14
12/14R-b
13/14R-b
14/14R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/14] Short circuit delivery for coredump signals

Oleg's recent patchset tweaking how force_sig_info works has inspired me to finally push through and update the signal handling to have proper short circuit deliver for coredump signals. Everything is just simpler when coredumps are not such a large special case.

What makes this tricky is coredumps have had their own process shoot-down logic similar to but separate and different from everything else in the kernel. The bulk of this set of changes is merging the process shoot-down logic that is used for signals and the logic for coredumps. So the same process shoot-down logic can be shared.

With the shoot-down logic sorted the rest is quite straight forward.

Oleg when reviewing the first version of this set of changes noticed that dequeue_exit_signal did not properly handle thread local signal that trigger a coredump. To resolve this I have added a few more cleanups so that I can detect a fatal signal as it is being enqueued and place it in the shared signal queue.

One of those cleanups is a rewrite of detecting if a signal can be delivered immediately when sent aka short circuit delivery. The processing of signals that will be ignored and signals that will cause a process to exit without returning to userspace (such as SIGKILL) are both enhanced.

This set of changes is against v7.2-rc1

 fs/coredump.c                          | 161 +++++++++++++++++----------------
 include/linux/coredump.h               |   4 +
 include/linux/sched/signal.h           |   2 +
 include/linux/sched/task.h             |   1 -
 include/linux/signal_types.h           |   3 -
 include/uapi/asm-generic/signal-defs.h |   1 -
 kernel/exit.c                          |  41 ++-------
 kernel/signal.c                        | 119 +++++++++++++++---------
 mm/oom_kill.c                          |   2 +-
 9 files changed, 171 insertions(+), 163 deletions(-)

Eric W. Biederman (14):
signal: Generalize posixtimer_queue_sigqueue into enqueue_signal
signal: Factor out sig_blocked from sig_ignored
signal: More accurate ignoring of signals based on sig_can_short_circuit
signal: Use sig_can_short_circuit to improve fatal signal delivery
signal: Compute the exit_code in get_signal
signal: In get_signal call do_exit when it is unnecessary to shoot down threads
signal: Bring down all threads when handling a non-coredump fatal signal
signal: Move stopping for the coredump from do_exit into get_signal
signal: Move audit_core_dumps from do_coredump into get_signal
coredump: In zap_threads complete startup if there is no need to wait
signal: Use the thread killing in get_signal for coredumps
exit: Make do_group_exit static
signal: Dequeue fatal signals
signal: Short circuit deliver coredump signals

 fs/coredump.c                | 153 ++++++++++++++-------------
 include/linux/coredump.h     |   4 +
 include/linux/sched/signal.h |   2 +
 include/linux/sched/task.h   |   1 -
 kernel/exit.c                |  41 ++------
 kernel/signal.c              | 246 +++++++++++++++++++++++++++++--------------
 mm/oom_kill.c                |   2 +-
 7 files changed, 260 insertions(+), 189 deletions(-)