[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211101034147.6203-2-khuey@kylehuey.com>
Date: Sun, 31 Oct 2021 20:41:46 -0700
From: Kyle Huey <me@...ehuey.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>,
Jens Axboe <axboe@...nel.dk>,
Peter Zijlstra <peterz@...radead.org>,
Marco Elver <elver@...gle.com>,
Oleg Nesterov <oleg@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Collingbourne <pcc@...gle.com>,
Alexey Gladkov <legion@...nel.org>
Cc: Robert O'Callahan <rocallahan@...il.com>,
Marko Mäkelä <marko.makela@...iadb.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] signal: factor out SIGKILL generation in get_signal
In preparation for adding a second case that will invoke the same code,
factor out this branch. Fix label formatting while we're nearby too.
Signed-off-by: Kyle Huey <khuey@...ehuey.com>
Reported-by: Marko Mäkelä <marko.makela@...iadb.com>
---
kernel/signal.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index 487bf4f5dadf..4d26ee5c662a 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2690,12 +2690,7 @@ bool get_signal(struct ksignal *ksig)
/* Has this task already been marked for death? */
if (signal_group_exit(signal)) {
- ksig->info.si_signo = signr = SIGKILL;
- sigdelset(¤t->pending.signal, SIGKILL);
- trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO,
- &sighand->action[SIGKILL - 1]);
- recalc_sigpending();
- goto fatal;
+ goto kill;
}
for (;;) {
@@ -2816,7 +2811,16 @@ bool get_signal(struct ksignal *ksig)
continue;
}
- fatal:
+ goto fatal;
+
+kill:
+ ksig->info.si_signo = signr = SIGKILL;
+ sigdelset(¤t->pending.signal, SIGKILL);
+ trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO,
+ &sighand->action[SIGKILL - 1]);
+ recalc_sigpending();
+
+fatal:
spin_unlock_irq(&sighand->siglock);
if (unlikely(cgroup_task_frozen(current)))
cgroup_leave_frozen(true);
--
2.33.1
Powered by blists - more mailing lists