signal: Replace __group_send_sig_info with send_signal_locked
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 22 Apr 2022 14:28:50 +0000 (09:28 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 11 May 2022 19:33:17 +0000 (14:33 -0500)
The function __group_send_sig_info is just a light wrapper around
send_signal_locked with one parameter fixed to a constant value.  As
the wrapper adds no real value update the code to directly call the
wrapped function.

Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lkml.kernel.org/r/20220505182645.497868-2-ebiederm@xmission.com
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
drivers/tty/tty_jobctrl.c
include/linux/signal.h
kernel/signal.c
kernel/time/posix-cpu-timers.c

index 80b86a7..0d04287 100644 (file)
@@ -215,8 +215,8 @@ int tty_signal_session_leader(struct tty_struct *tty, int exit_session)
                                spin_unlock_irq(&p->sighand->siglock);
                                continue;
                        }
-                       __group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p);
-                       __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p);
+                       send_signal_locked(SIGHUP, SEND_SIG_PRIV, p, PIDTYPE_TGID);
+                       send_signal_locked(SIGCONT, SEND_SIG_PRIV, p, PIDTYPE_TGID);
                        put_pid(p->signal->tty_old_pgrp);  /* A noop */
                        spin_lock(&tty->ctrl.lock);
                        tty_pgrp = get_pid(tty->ctrl.pgrp);
index 55605bd..3b98e7a 100644 (file)
@@ -282,7 +282,6 @@ extern int do_send_sig_info(int sig, struct kernel_siginfo *info,
                                struct task_struct *p, enum pid_type type);
 extern int group_send_sig_info(int sig, struct kernel_siginfo *info,
                               struct task_struct *p, enum pid_type type);
-extern int __group_send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
 extern int send_signal_locked(int sig, struct kernel_siginfo *info,
                              struct task_struct *p, enum pid_type type);
 extern int sigprocmask(int, sigset_t *, sigset_t *);
index b040319..72d9661 100644 (file)
@@ -1281,12 +1281,6 @@ static int __init setup_print_fatal_signals(char *str)
 
 __setup("print-fatal-signals=", setup_print_fatal_signals);
 
-int
-__group_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p)
-{
-       return send_signal_locked(sig, info, p, PIDTYPE_TGID);
-}
-
 int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p,
                        enum pid_type type)
 {
@@ -2173,7 +2167,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
        spin_lock_irqsave(&sighand->siglock, flags);
        if (sighand->action[SIGCHLD-1].sa.sa_handler != SIG_IGN &&
            !(sighand->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
-               __group_send_sig_info(SIGCHLD, &info, parent);
+               send_signal_locked(SIGCHLD, &info, parent, PIDTYPE_TGID);
        /*
         * Even if SIGCHLD is not generated, we must wake up wait4 calls.
         */
index 0a97193..cb925e8 100644 (file)
@@ -870,7 +870,7 @@ static inline void check_dl_overrun(struct task_struct *tsk)
 {
        if (tsk->dl.dl_overrun) {
                tsk->dl.dl_overrun = 0;
-               __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
+               send_signal_locked(SIGXCPU, SEND_SIG_PRIV, tsk, PIDTYPE_TGID);
        }
 }
 
@@ -884,7 +884,7 @@ static bool check_rlimit(u64 time, u64 limit, int signo, bool rt, bool hard)
                        rt ? "RT" : "CPU", hard ? "hard" : "soft",
                        current->comm, task_pid_nr(current));
        }
-       __group_send_sig_info(signo, SEND_SIG_PRIV, current);
+       send_signal_locked(signo, SEND_SIG_PRIV, current, PIDTYPE_TGID);
        return true;
 }
 
@@ -958,7 +958,7 @@ static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
                trace_itimer_expire(signo == SIGPROF ?
                                    ITIMER_PROF : ITIMER_VIRTUAL,
                                    task_tgid(tsk), cur_time);
-               __group_send_sig_info(signo, SEND_SIG_PRIV, tsk);
+               send_signal_locked(signo, SEND_SIG_PRIV, tsk, PIDTYPE_TGID);
        }
 
        if (it->expires && it->expires < *expires)