Skip to content

Commit e71ba12

Browse files
committed
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: Kees Cook <[email protected]> Reviewed-by: Oleg Nesterov <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: "Eric W. Biederman" <[email protected]>
1 parent 157cc18 commit e71ba12

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

drivers/tty/tty_jobctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ int tty_signal_session_leader(struct tty_struct *tty, int exit_session)
215215
spin_unlock_irq(&p->sighand->siglock);
216216
continue;
217217
}
218-
__group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p);
219-
__group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p);
218+
send_signal_locked(SIGHUP, SEND_SIG_PRIV, p, PIDTYPE_TGID);
219+
send_signal_locked(SIGCONT, SEND_SIG_PRIV, p, PIDTYPE_TGID);
220220
put_pid(p->signal->tty_old_pgrp); /* A noop */
221221
spin_lock(&tty->ctrl.lock);
222222
tty_pgrp = get_pid(tty->ctrl.pgrp);

include/linux/signal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ extern int do_send_sig_info(int sig, struct kernel_siginfo *info,
282282
struct task_struct *p, enum pid_type type);
283283
extern int group_send_sig_info(int sig, struct kernel_siginfo *info,
284284
struct task_struct *p, enum pid_type type);
285-
extern int __group_send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
286285
extern int send_signal_locked(int sig, struct kernel_siginfo *info,
287286
struct task_struct *p, enum pid_type type);
288287
extern int sigprocmask(int, sigset_t *, sigset_t *);

kernel/signal.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,12 +1281,6 @@ static int __init setup_print_fatal_signals(char *str)
12811281

12821282
__setup("print-fatal-signals=", setup_print_fatal_signals);
12831283

1284-
int
1285-
__group_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p)
1286-
{
1287-
return send_signal_locked(sig, info, p, PIDTYPE_TGID);
1288-
}
1289-
12901284
int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p,
12911285
enum pid_type type)
12921286
{
@@ -2173,7 +2167,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
21732167
spin_lock_irqsave(&sighand->siglock, flags);
21742168
if (sighand->action[SIGCHLD-1].sa.sa_handler != SIG_IGN &&
21752169
!(sighand->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
2176-
__group_send_sig_info(SIGCHLD, &info, parent);
2170+
send_signal_locked(SIGCHLD, &info, parent, PIDTYPE_TGID);
21772171
/*
21782172
* Even if SIGCHLD is not generated, we must wake up wait4 calls.
21792173
*/

kernel/time/posix-cpu-timers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ static inline void check_dl_overrun(struct task_struct *tsk)
870870
{
871871
if (tsk->dl.dl_overrun) {
872872
tsk->dl.dl_overrun = 0;
873-
__group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
873+
send_signal_locked(SIGXCPU, SEND_SIG_PRIV, tsk, PIDTYPE_TGID);
874874
}
875875
}
876876

@@ -884,7 +884,7 @@ static bool check_rlimit(u64 time, u64 limit, int signo, bool rt, bool hard)
884884
rt ? "RT" : "CPU", hard ? "hard" : "soft",
885885
current->comm, task_pid_nr(current));
886886
}
887-
__group_send_sig_info(signo, SEND_SIG_PRIV, current);
887+
send_signal_locked(signo, SEND_SIG_PRIV, current, PIDTYPE_TGID);
888888
return true;
889889
}
890890

@@ -958,7 +958,7 @@ static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
958958
trace_itimer_expire(signo == SIGPROF ?
959959
ITIMER_PROF : ITIMER_VIRTUAL,
960960
task_tgid(tsk), cur_time);
961-
__group_send_sig_info(signo, SEND_SIG_PRIV, tsk);
961+
send_signal_locked(signo, SEND_SIG_PRIV, tsk, PIDTYPE_TGID);
962962
}
963963

964964
if (it->expires && it->expires < *expires)

0 commit comments

Comments
 (0)