Skip to content

Commit a89e9b8

Browse files
committed
signal: Remove the signal number and task parameters from force_sig_info
force_sig_info always delivers to the current task and the signal parameter always matches info.si_signo. So remove those parameters to make it a simpler less error prone interface, and to make it clear that none of the callers are doing anything clever. This guarantees that force_sig_info will not grow any new buggy callers that attempt to call force_sig on a non-current task, or that pass an signal number that does not match info.si_signo. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
1 parent 59c0e69 commit a89e9b8

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎include/linux/ptrace.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static inline void user_single_step_report(struct pt_regs *regs)
355355
info.si_code = SI_USER;
356356
info.si_pid = 0;
357357
info.si_uid = 0;
358-
force_sig_info(info.si_signo, &info, current);
358+
force_sig_info(&info);
359359
}
360360
#endif
361361

‎include/linux/sched/signal.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ int force_sig_ptrace_errno_trap(int errno, void __user *addr);
329329

330330
extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
331331
extern void force_sigsegv(int sig);
332-
extern int force_sig_info(int, struct kernel_siginfo *, struct task_struct *);
332+
extern int force_sig_info(struct kernel_siginfo *);
333333
extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp);
334334
extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid);
335335
extern int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, struct pid *,

‎kernel/seccomp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ static void seccomp_send_sigsys(int syscall, int reason)
609609
{
610610
struct kernel_siginfo info;
611611
seccomp_init_siginfo(&info, syscall, reason);
612-
force_sig_info(SIGSYS, &info, current);
612+
force_sig_info(&info);
613613
}
614614
#endif /* CONFIG_SECCOMP_FILTER */
615615

‎kernel/signal.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,9 +1325,9 @@ force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t)
13251325
return ret;
13261326
}
13271327

1328-
int force_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *t)
1328+
int force_sig_info(struct kernel_siginfo *info)
13291329
{
1330-
return force_sig_info_to_task(info, t);
1330+
return force_sig_info_to_task(info, current);
13311331
}
13321332

13331333
/*
@@ -1619,7 +1619,7 @@ void force_sig(int sig)
16191619
info.si_code = SI_KERNEL;
16201620
info.si_pid = 0;
16211621
info.si_uid = 0;
1622-
force_sig_info(info.si_signo, &info, current);
1622+
force_sig_info(&info);
16231623
}
16241624
EXPORT_SYMBOL(force_sig);
16251625

@@ -1708,7 +1708,7 @@ int force_sig_mceerr(int code, void __user *addr, short lsb)
17081708
info.si_code = code;
17091709
info.si_addr = addr;
17101710
info.si_addr_lsb = lsb;
1711-
return force_sig_info(info.si_signo, &info, current);
1711+
return force_sig_info(&info);
17121712
}
17131713

17141714
int send_sig_mceerr(int code, void __user *addr, short lsb, struct task_struct *t)
@@ -1737,7 +1737,7 @@ int force_sig_bnderr(void __user *addr, void __user *lower, void __user *upper)
17371737
info.si_addr = addr;
17381738
info.si_lower = lower;
17391739
info.si_upper = upper;
1740-
return force_sig_info(info.si_signo, &info, current);
1740+
return force_sig_info(&info);
17411741
}
17421742

17431743
#ifdef SEGV_PKUERR
@@ -1751,7 +1751,7 @@ int force_sig_pkuerr(void __user *addr, u32 pkey)
17511751
info.si_code = SEGV_PKUERR;
17521752
info.si_addr = addr;
17531753
info.si_pkey = pkey;
1754-
return force_sig_info(info.si_signo, &info, current);
1754+
return force_sig_info(&info);
17551755
}
17561756
#endif
17571757

@@ -1767,7 +1767,7 @@ int force_sig_ptrace_errno_trap(int errno, void __user *addr)
17671767
info.si_errno = errno;
17681768
info.si_code = TRAP_HWBKPT;
17691769
info.si_addr = addr;
1770-
return force_sig_info(info.si_signo, &info, current);
1770+
return force_sig_info(&info);
17711771
}
17721772

17731773
int kill_pgrp(struct pid *pid, int sig, int priv)

0 commit comments

Comments
 (0)