Commit e71ba124 authored by Eric W. Biederman's avatar Eric W. Biederman

signal: Replace __group_send_sig_info with send_signal_locked

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: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
Link: https://lkml.kernel.org/r/20220505182645.497868-2-ebiederm@xmission.comSigned-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 157cc181
...@@ -215,8 +215,8 @@ int tty_signal_session_leader(struct tty_struct *tty, int exit_session) ...@@ -215,8 +215,8 @@ int tty_signal_session_leader(struct tty_struct *tty, int exit_session)
spin_unlock_irq(&p->sighand->siglock); spin_unlock_irq(&p->sighand->siglock);
continue; continue;
} }
__group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p); send_signal_locked(SIGHUP, SEND_SIG_PRIV, p, PIDTYPE_TGID);
__group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p); send_signal_locked(SIGCONT, SEND_SIG_PRIV, p, PIDTYPE_TGID);
put_pid(p->signal->tty_old_pgrp); /* A noop */ put_pid(p->signal->tty_old_pgrp); /* A noop */
spin_lock(&tty->ctrl.lock); spin_lock(&tty->ctrl.lock);
tty_pgrp = get_pid(tty->ctrl.pgrp); tty_pgrp = get_pid(tty->ctrl.pgrp);
......
...@@ -282,7 +282,6 @@ extern int do_send_sig_info(int sig, struct kernel_siginfo *info, ...@@ -282,7 +282,6 @@ extern int do_send_sig_info(int sig, struct kernel_siginfo *info,
struct task_struct *p, enum pid_type type); struct task_struct *p, enum pid_type type);
extern int group_send_sig_info(int sig, struct kernel_siginfo *info, extern int group_send_sig_info(int sig, struct kernel_siginfo *info,
struct task_struct *p, enum pid_type type); 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, extern int send_signal_locked(int sig, struct kernel_siginfo *info,
struct task_struct *p, enum pid_type type); struct task_struct *p, enum pid_type type);
extern int sigprocmask(int, sigset_t *, sigset_t *); extern int sigprocmask(int, sigset_t *, sigset_t *);
......
...@@ -1281,12 +1281,6 @@ static int __init setup_print_fatal_signals(char *str) ...@@ -1281,12 +1281,6 @@ static int __init setup_print_fatal_signals(char *str)
__setup("print-fatal-signals=", setup_print_fatal_signals); __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, int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p,
enum pid_type type) enum pid_type type)
{ {
...@@ -2173,7 +2167,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, ...@@ -2173,7 +2167,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
spin_lock_irqsave(&sighand->siglock, flags); spin_lock_irqsave(&sighand->siglock, flags);
if (sighand->action[SIGCHLD-1].sa.sa_handler != SIG_IGN && if (sighand->action[SIGCHLD-1].sa.sa_handler != SIG_IGN &&
!(sighand->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) !(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. * Even if SIGCHLD is not generated, we must wake up wait4 calls.
*/ */
......
...@@ -870,7 +870,7 @@ static inline void check_dl_overrun(struct task_struct *tsk) ...@@ -870,7 +870,7 @@ static inline void check_dl_overrun(struct task_struct *tsk)
{ {
if (tsk->dl.dl_overrun) { if (tsk->dl.dl_overrun) {
tsk->dl.dl_overrun = 0; 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) ...@@ -884,7 +884,7 @@ static bool check_rlimit(u64 time, u64 limit, int signo, bool rt, bool hard)
rt ? "RT" : "CPU", hard ? "hard" : "soft", rt ? "RT" : "CPU", hard ? "hard" : "soft",
current->comm, task_pid_nr(current)); 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; return true;
} }
...@@ -958,7 +958,7 @@ static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it, ...@@ -958,7 +958,7 @@ static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
trace_itimer_expire(signo == SIGPROF ? trace_itimer_expire(signo == SIGPROF ?
ITIMER_PROF : ITIMER_VIRTUAL, ITIMER_PROF : ITIMER_VIRTUAL,
task_tgid(tsk), cur_time); 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) if (it->expires && it->expires < *expires)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment