aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/fault.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:48:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:48:15 -0400
commit5ad18b2e60b75c7297a998dea702451d33a052ed (patch)
treec47fb503b4cfc8d3e99ad425aadede9832e96dc4 /arch/sh/mm/fault.c
parent92c1d6522135050cb377a18cc6e30d08dfb87efb (diff)
parent318759b4737c3b3789e2fd64d539f437d52386f5 (diff)
Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull force_sig() argument change from Eric Biederman: "A source of error over the years has been that force_sig has taken a task parameter when it is only safe to use force_sig with the current task. The force_sig function is built for delivering synchronous signals such as SIGSEGV where the userspace application caused a synchronous fault (such as a page fault) and the kernel responded with a signal. Because the name force_sig does not make this clear, and because the force_sig takes a task parameter the function force_sig has been abused for sending other kinds of signals over the years. Slowly those have been fixed when the oopses have been tracked down. This set of changes fixes the remaining abusers of force_sig and carefully rips out the task parameter from force_sig and friends making this kind of error almost impossible in the future" * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (27 commits) signal/x86: Move tsk inside of CONFIG_MEMORY_FAILURE in do_sigbus signal: Remove the signal number and task parameters from force_sig_info signal: Factor force_sig_info_to_task out of force_sig_info signal: Generate the siginfo in force_sig signal: Move the computation of force into send_signal and correct it. signal: Properly set TRACE_SIGNAL_LOSE_INFO in __send_signal signal: Remove the task parameter from force_sig_fault signal: Use force_sig_fault_to_task for the two calls that don't deliver to current signal: Explicitly call force_sig_fault on current signal/unicore32: Remove tsk parameter from __do_user_fault signal/arm: Remove tsk parameter from __do_user_fault signal/arm: Remove tsk parameter from ptrace_break signal/nds32: Remove tsk parameter from send_sigtrap signal/riscv: Remove tsk parameter from do_trap signal/sh: Remove tsk parameter from force_sig_info_fault signal/um: Remove task parameter from send_sigtrap signal/x86: Remove task parameter from send_sigtrap signal: Remove task parameter from force_sig_mceerr signal: Remove task parameter from force_sig signal: Remove task parameter from force_sigsegv ...
Diffstat (limited to 'arch/sh/mm/fault.c')
-rw-r--r--arch/sh/mm/fault.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index 6defd2c6d9b1..3093bc372138 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -39,10 +39,9 @@ static inline int notify_page_fault(struct pt_regs *regs, int trap)
39} 39}
40 40
41static void 41static void
42force_sig_info_fault(int si_signo, int si_code, unsigned long address, 42force_sig_info_fault(int si_signo, int si_code, unsigned long address)
43 struct task_struct *tsk)
44{ 43{
45 force_sig_fault(si_signo, si_code, (void __user *)address, tsk); 44 force_sig_fault(si_signo, si_code, (void __user *)address);
46} 45}
47 46
48/* 47/*
@@ -244,8 +243,6 @@ static void
244__bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, 243__bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
245 unsigned long address, int si_code) 244 unsigned long address, int si_code)
246{ 245{
247 struct task_struct *tsk = current;
248
249 /* User mode accesses just cause a SIGSEGV */ 246 /* User mode accesses just cause a SIGSEGV */
250 if (user_mode(regs)) { 247 if (user_mode(regs)) {
251 /* 248 /*
@@ -253,7 +250,7 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
253 */ 250 */
254 local_irq_enable(); 251 local_irq_enable();
255 252
256 force_sig_info_fault(SIGSEGV, si_code, address, tsk); 253 force_sig_info_fault(SIGSEGV, si_code, address);
257 254
258 return; 255 return;
259 } 256 }
@@ -308,7 +305,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address)
308 if (!user_mode(regs)) 305 if (!user_mode(regs))
309 no_context(regs, error_code, address); 306 no_context(regs, error_code, address);
310 307
311 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk); 308 force_sig_info_fault(SIGBUS, BUS_ADRERR, address);
312} 309}
313 310
314static noinline int 311static noinline int