summaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2019-02-06 17:39:13 -0500
committerEric W. Biederman <ebiederm@xmission.com>2019-05-29 10:31:43 -0400
commit91ca180dbdd687d45fe4aab055b02d29c91b90df (patch)
tree468888ea5dfa8f2177bbd62efcefe6484fb3870f /kernel/signal.c
parent351b6825b3a9f70bab080fba67aec104ff9a41d6 (diff)
signal: Use force_sig_fault_to_task for the two calls that don't deliver to current
In preparation for removing the task parameter from force_sig_fault introduce force_sig_fault_to_task and use it for the two cases where it matters. On mips force_fcr31_sig calls force_sig_fault and is called on either the current task, or a task that is suspended and is being switched to by the scheduler. This is safe because the task being switched to by the scheduler is guaranteed to be suspended. This ensures that task->sighand is stable while the signal is delivered to it. On parisc user_enable_single_step calls force_sig_fault and is in turn called by ptrace_request. The function ptrace_request always calls user_enable_single_step on a child that is stopped for tracing. The child being traced and not reaped ensures that child->sighand is not NULL, and that the child will not change child->sighand. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 398489facf9f..e420489ac4c9 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1620,7 +1620,7 @@ void force_sigsegv(int sig)
1620 force_sig(SIGSEGV); 1620 force_sig(SIGSEGV);
1621} 1621}
1622 1622
1623int force_sig_fault(int sig, int code, void __user *addr 1623int force_sig_fault_to_task(int sig, int code, void __user *addr
1624 ___ARCH_SI_TRAPNO(int trapno) 1624 ___ARCH_SI_TRAPNO(int trapno)
1625 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) 1625 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
1626 , struct task_struct *t) 1626 , struct task_struct *t)
@@ -1643,6 +1643,16 @@ int force_sig_fault(int sig, int code, void __user *addr
1643 return force_sig_info(info.si_signo, &info, t); 1643 return force_sig_info(info.si_signo, &info, t);
1644} 1644}
1645 1645
1646int force_sig_fault(int sig, int code, void __user *addr
1647 ___ARCH_SI_TRAPNO(int trapno)
1648 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
1649 , struct task_struct *t)
1650{
1651 return force_sig_fault_to_task(sig, code, addr
1652 ___ARCH_SI_TRAPNO(trapno)
1653 ___ARCH_SI_IA64(imm, flags, isr), t);
1654}
1655
1646int send_sig_fault(int sig, int code, void __user *addr 1656int send_sig_fault(int sig, int code, void __user *addr
1647 ___ARCH_SI_TRAPNO(int trapno) 1657 ___ARCH_SI_TRAPNO(int trapno)
1648 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) 1658 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)