--- zzzz-none-000/linux-5.4.213/kernel/signal.c 2022-09-15 10:04:56.000000000 +0000 +++ miami-7690-761/linux-5.4.213/kernel/signal.c 2024-05-29 11:20:02.000000000 +0000 @@ -1281,6 +1281,14 @@ return send_signal(sig, info, p, PIDTYPE_TGID); } +static bool sig_debug; +static int __init sig_debug_setup(char *__unused) +{ + sig_debug = true; + return 1; +} +__setup("sig_debug", sig_debug_setup); + int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p, enum pid_type type) { @@ -1288,6 +1296,9 @@ int ret = -ESRCH; if (lock_task_sighand(p, &flags)) { + if ((sig_debug && (sig == SIGKILL || sig == SIGTERM || sig == SIGINT))) + pr_info("The process %d: %s sending signal %d to the process %d: %s\n", + task_pid_nr(current), current->comm, sig,p->pid, p->comm); ret = send_signal(sig, info, p, type); unlock_task_sighand(p, &flags); }