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>
This commit is contained in:
Eric W. Biederman 2019-05-15 10:11:09 -05:00
parent 59c0e696a6
commit a89e9b8abf
4 changed files with 10 additions and 10 deletions

View File

@ -355,7 +355,7 @@ static inline void user_single_step_report(struct pt_regs *regs)
info.si_code = SI_USER; info.si_code = SI_USER;
info.si_pid = 0; info.si_pid = 0;
info.si_uid = 0; info.si_uid = 0;
force_sig_info(info.si_signo, &info, current); force_sig_info(&info);
} }
#endif #endif

View File

@ -329,7 +329,7 @@ int force_sig_ptrace_errno_trap(int errno, void __user *addr);
extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *); extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
extern void force_sigsegv(int sig); extern void force_sigsegv(int sig);
extern int force_sig_info(int, struct kernel_siginfo *, struct task_struct *); extern int force_sig_info(struct kernel_siginfo *);
extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp); extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp);
extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid); extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid);
extern int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, struct pid *, extern int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, struct pid *,

View File

@ -609,7 +609,7 @@ static void seccomp_send_sigsys(int syscall, int reason)
{ {
struct kernel_siginfo info; struct kernel_siginfo info;
seccomp_init_siginfo(&info, syscall, reason); seccomp_init_siginfo(&info, syscall, reason);
force_sig_info(SIGSYS, &info, current); force_sig_info(&info);
} }
#endif /* CONFIG_SECCOMP_FILTER */ #endif /* CONFIG_SECCOMP_FILTER */

View File

@ -1325,9 +1325,9 @@ force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t)
return ret; return ret;
} }
int force_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *t) int force_sig_info(struct kernel_siginfo *info)
{ {
return force_sig_info_to_task(info, t); return force_sig_info_to_task(info, current);
} }
/* /*
@ -1619,7 +1619,7 @@ void force_sig(int sig)
info.si_code = SI_KERNEL; info.si_code = SI_KERNEL;
info.si_pid = 0; info.si_pid = 0;
info.si_uid = 0; info.si_uid = 0;
force_sig_info(info.si_signo, &info, current); force_sig_info(&info);
} }
EXPORT_SYMBOL(force_sig); EXPORT_SYMBOL(force_sig);
@ -1708,7 +1708,7 @@ int force_sig_mceerr(int code, void __user *addr, short lsb)
info.si_code = code; info.si_code = code;
info.si_addr = addr; info.si_addr = addr;
info.si_addr_lsb = lsb; info.si_addr_lsb = lsb;
return force_sig_info(info.si_signo, &info, current); return force_sig_info(&info);
} }
int send_sig_mceerr(int code, void __user *addr, short lsb, struct task_struct *t) 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)
info.si_addr = addr; info.si_addr = addr;
info.si_lower = lower; info.si_lower = lower;
info.si_upper = upper; info.si_upper = upper;
return force_sig_info(info.si_signo, &info, current); return force_sig_info(&info);
} }
#ifdef SEGV_PKUERR #ifdef SEGV_PKUERR
@ -1751,7 +1751,7 @@ int force_sig_pkuerr(void __user *addr, u32 pkey)
info.si_code = SEGV_PKUERR; info.si_code = SEGV_PKUERR;
info.si_addr = addr; info.si_addr = addr;
info.si_pkey = pkey; info.si_pkey = pkey;
return force_sig_info(info.si_signo, &info, current); return force_sig_info(&info);
} }
#endif #endif
@ -1767,7 +1767,7 @@ int force_sig_ptrace_errno_trap(int errno, void __user *addr)
info.si_errno = errno; info.si_errno = errno;
info.si_code = TRAP_HWBKPT; info.si_code = TRAP_HWBKPT;
info.si_addr = addr; info.si_addr = addr;
return force_sig_info(info.si_signo, &info, current); return force_sig_info(&info);
} }
int kill_pgrp(struct pid *pid, int sig, int priv) int kill_pgrp(struct pid *pid, int sig, int priv)