Skip to content

Commit 49fd5f5

Browse files
oleg-nesterovakpm00
authored andcommitted
get_signal: don't abuse ksig->info.si_signo and ksig->sig
Patch series "get_signal: minor cleanups and fix". Lets remove this clear_siginfo() right now. It is incomplete (and thus looks confusing) and unnecessary. Also, PF_USER_WORKER's already don't get a fully initialized ksig anyway. This patch (of 3): Cleanup and preparation for the next changes. get_signal() uses signr or ksig->info.si_signo or ksig->sig in a chaotic way, this looks confusing. Change it to always use signr. Link: https://lkml.kernel.org/r/20240226165612.GA20787@redhat.com Link: https://lkml.kernel.org/r/20240226165647.GA20826@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Christian Brauner <brauner@kernel.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Peter Collingbourne <pcc@google.com> Cc: Wen Yang <wenyang.linux@foxmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 3606422 commit 49fd5f5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

kernel/signal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,7 +2842,7 @@ bool get_signal(struct ksignal *ksig)
28422842
spin_lock_irq(&sighand->siglock);
28432843
}
28442844

2845-
if (likely(do_signal_stop(ksig->info.si_signo))) {
2845+
if (likely(do_signal_stop(signr))) {
28462846
/* It released the siglock. */
28472847
goto relock;
28482848
}
@@ -2866,7 +2866,7 @@ bool get_signal(struct ksignal *ksig)
28662866

28672867
if (sig_kernel_coredump(signr)) {
28682868
if (print_fatal_signals)
2869-
print_fatal_signal(ksig->info.si_signo);
2869+
print_fatal_signal(signr);
28702870
proc_coredump_connector(current);
28712871
/*
28722872
* If it was able to dump core, this kills all
@@ -2890,7 +2890,7 @@ bool get_signal(struct ksignal *ksig)
28902890
/*
28912891
* Death signals, no core dump.
28922892
*/
2893-
do_group_exit(ksig->info.si_signo);
2893+
do_group_exit(signr);
28942894
/* NOTREACHED */
28952895
}
28962896
spin_unlock_irq(&sighand->siglock);
@@ -2900,7 +2900,7 @@ bool get_signal(struct ksignal *ksig)
29002900
if (!(ksig->ka.sa.sa_flags & SA_EXPOSE_TAGBITS))
29012901
hide_si_addr_tag_bits(ksig);
29022902

2903-
return ksig->sig > 0;
2903+
return signr > 0;
29042904
}
29052905

29062906
/**

0 commit comments

Comments
 (0)