summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2019-02-07 10:25:08 -0500
committerEric W. Biederman <ebiederm@xmission.com>2019-05-29 10:31:43 -0400
commit351b6825b3a9f70bab080fba67aec104ff9a41d6 (patch)
tree8d46d573a342393df13a874fabd20af264cae458
parentec74e9205e064af6a7076faabe649335acc78b69 (diff)
signal: Explicitly call force_sig_fault on current
Update the calls of force_sig_fault that pass in a variable that is set to current earlier to explicitly use current. This is to make the next change that removes the task parameter from force_sig_fault easier to verify. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r--arch/arc/kernel/traps.c2
-rw-r--r--arch/arc/mm/fault.c4
-rw-r--r--arch/arm/mm/fault.c2
-rw-r--r--arch/mips/mm/fault.c4
-rw-r--r--arch/nds32/kernel/traps.c2
-rw-r--r--arch/nds32/mm/fault.c4
-rw-r--r--arch/openrisc/mm/fault.c4
-rw-r--r--arch/riscv/kernel/traps.c2
-rw-r--r--arch/sh/math-emu/math.c2
-rw-r--r--arch/unicore32/mm/fault.c2
-rw-r--r--arch/x86/kernel/ptrace.c2
-rw-r--r--arch/x86/kernel/traps.c4
-rw-r--r--arch/x86/kernel/umip.c2
-rw-r--r--arch/x86/mm/fault.c6
14 files changed, 21 insertions, 21 deletions
diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c
index a7fcbc0d3943..e618fbb3e28d 100644
--- a/arch/arc/kernel/traps.c
+++ b/arch/arc/kernel/traps.c
@@ -50,7 +50,7 @@ unhandled_exception(const char *str, struct pt_regs *regs,
50 50
51 tsk->thread.fault_address = (__force unsigned int)addr; 51 tsk->thread.fault_address = (__force unsigned int)addr;
52 52
53 force_sig_fault(signo, si_code, addr, tsk); 53 force_sig_fault(signo, si_code, addr, current);
54 54
55 } else { 55 } else {
56 /* If not due to copy_(to|from)_user, we are doomed */ 56 /* If not due to copy_(to|from)_user, we are doomed */
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c
index 8df1638259f3..d5d4758d7e75 100644
--- a/arch/arc/mm/fault.c
+++ b/arch/arc/mm/fault.c
@@ -202,7 +202,7 @@ bad_area_nosemaphore:
202 /* User mode accesses just cause a SIGSEGV */ 202 /* User mode accesses just cause a SIGSEGV */
203 if (user_mode(regs)) { 203 if (user_mode(regs)) {
204 tsk->thread.fault_address = address; 204 tsk->thread.fault_address = address;
205 force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); 205 force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
206 return; 206 return;
207 } 207 }
208 208
@@ -237,5 +237,5 @@ do_sigbus:
237 goto no_context; 237 goto no_context;
238 238
239 tsk->thread.fault_address = address; 239 tsk->thread.fault_address = address;
240 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); 240 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
241} 241}
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 324def0279b2..03007ea4cc72 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -184,7 +184,7 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig,
184 tsk->thread.address = addr; 184 tsk->thread.address = addr;
185 tsk->thread.error_code = fsr; 185 tsk->thread.error_code = fsr;
186 tsk->thread.trap_no = 14; 186 tsk->thread.trap_no = 14;
187 force_sig_fault(sig, code, (void __user *)addr, tsk); 187 force_sig_fault(sig, code, (void __user *)addr, current);
188} 188}
189 189
190void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) 190void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 73d8a0f0b810..e63abd492f65 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -223,7 +223,7 @@ bad_area_nosemaphore:
223 pr_cont("\n"); 223 pr_cont("\n");
224 } 224 }
225 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f; 225 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f;
226 force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); 226 force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
227 return; 227 return;
228 } 228 }
229 229
@@ -279,7 +279,7 @@ do_sigbus:
279#endif 279#endif
280 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f; 280 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f;
281 tsk->thread.cp0_badvaddr = address; 281 tsk->thread.cp0_badvaddr = address;
282 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); 282 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
283 283
284 return; 284 return;
285#ifndef CONFIG_64BIT 285#ifndef CONFIG_64BIT
diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c
index 66f197efcec9..a16e97f7bc75 100644
--- a/arch/nds32/kernel/traps.c
+++ b/arch/nds32/kernel/traps.c
@@ -263,7 +263,7 @@ static void send_sigtrap(struct pt_regs *regs, int error_code, int si_code)
263 tsk->thread.error_code = error_code; 263 tsk->thread.error_code = error_code;
264 264
265 force_sig_fault(SIGTRAP, si_code, 265 force_sig_fault(SIGTRAP, si_code,
266 (void __user *)instruction_pointer(regs), tsk); 266 (void __user *)instruction_pointer(regs), current);
267} 267}
268 268
269void do_debug_trap(unsigned long entry, unsigned long addr, 269void do_debug_trap(unsigned long entry, unsigned long addr,
diff --git a/arch/nds32/mm/fault.c b/arch/nds32/mm/fault.c
index 68d5f2a27f38..38441113c202 100644
--- a/arch/nds32/mm/fault.c
+++ b/arch/nds32/mm/fault.c
@@ -271,7 +271,7 @@ bad_area_nosemaphore:
271 tsk->thread.address = addr; 271 tsk->thread.address = addr;
272 tsk->thread.error_code = error_code; 272 tsk->thread.error_code = error_code;
273 tsk->thread.trap_no = entry; 273 tsk->thread.trap_no = entry;
274 force_sig_fault(SIGSEGV, si_code, (void __user *)addr, tsk); 274 force_sig_fault(SIGSEGV, si_code, (void __user *)addr, current);
275 return; 275 return;
276 } 276 }
277 277
@@ -340,7 +340,7 @@ do_sigbus:
340 tsk->thread.address = addr; 340 tsk->thread.address = addr;
341 tsk->thread.error_code = error_code; 341 tsk->thread.error_code = error_code;
342 tsk->thread.trap_no = entry; 342 tsk->thread.trap_no = entry;
343 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)addr, tsk); 343 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)addr, current);
344 344
345 return; 345 return;
346 346
diff --git a/arch/openrisc/mm/fault.c b/arch/openrisc/mm/fault.c
index dc4dbafc1d83..f8b3a5a6ba3a 100644
--- a/arch/openrisc/mm/fault.c
+++ b/arch/openrisc/mm/fault.c
@@ -213,7 +213,7 @@ bad_area_nosemaphore:
213 /* User mode accesses just cause a SIGSEGV */ 213 /* User mode accesses just cause a SIGSEGV */
214 214
215 if (user_mode(regs)) { 215 if (user_mode(regs)) {
216 force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); 216 force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
217 return; 217 return;
218 } 218 }
219 219
@@ -278,7 +278,7 @@ do_sigbus:
278 * Send a sigbus, regardless of whether we were in kernel 278 * Send a sigbus, regardless of whether we were in kernel
279 * or user mode. 279 * or user mode.
280 */ 280 */
281 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); 281 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
282 282
283 /* Kernel mode? Handle exceptions or die */ 283 /* Kernel mode? Handle exceptions or die */
284 if (!user_mode(regs)) 284 if (!user_mode(regs))
diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
index 71445a928c1b..6d67892dfc82 100644
--- a/arch/riscv/kernel/traps.c
+++ b/arch/riscv/kernel/traps.c
@@ -76,7 +76,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr)
76 show_regs(regs); 76 show_regs(regs);
77 } 77 }
78 78
79 force_sig_fault(signo, code, (void __user *)addr, tsk); 79 force_sig_fault(signo, code, (void __user *)addr, current);
80} 80}
81 81
82static void do_trap_error(struct pt_regs *regs, int signo, int code, 82static void do_trap_error(struct pt_regs *regs, int signo, int code,
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index a0fa8fc88739..fe261b0983cc 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -560,7 +560,7 @@ static int ieee_fpe_handler(struct pt_regs *regs)
560 task_thread_info(tsk)->status |= TS_USEDFPU; 560 task_thread_info(tsk)->status |= TS_USEDFPU;
561 } else { 561 } else {
562 force_sig_fault(SIGFPE, FPE_FLTINV, 562 force_sig_fault(SIGFPE, FPE_FLTINV,
563 (void __user *)regs->pc, tsk); 563 (void __user *)regs->pc, current);
564 } 564 }
565 565
566 regs->pc = nextpc; 566 regs->pc = nextpc;
diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c
index cadee0b3b4e0..313547a93513 100644
--- a/arch/unicore32/mm/fault.c
+++ b/arch/unicore32/mm/fault.c
@@ -124,7 +124,7 @@ static void __do_user_fault(unsigned long addr, unsigned int fsr,
124 tsk->thread.address = addr; 124 tsk->thread.address = addr;
125 tsk->thread.error_code = fsr; 125 tsk->thread.error_code = fsr;
126 tsk->thread.trap_no = 14; 126 tsk->thread.trap_no = 14;
127 force_sig_fault(sig, code, (void __user *)addr, tsk); 127 force_sig_fault(sig, code, (void __user *)addr, current);
128} 128}
129 129
130void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) 130void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 00148141f138..34d27b2dc7a1 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -1369,7 +1369,7 @@ void send_sigtrap(struct pt_regs *regs, int error_code, int si_code)
1369 1369
1370 /* Send us the fake SIGTRAP */ 1370 /* Send us the fake SIGTRAP */
1371 force_sig_fault(SIGTRAP, si_code, 1371 force_sig_fault(SIGTRAP, si_code,
1372 user_mode(regs) ? (void __user *)regs->ip : NULL, tsk); 1372 user_mode(regs) ? (void __user *)regs->ip : NULL, current);
1373} 1373}
1374 1374
1375void user_single_step_report(struct pt_regs *regs) 1375void user_single_step_report(struct pt_regs *regs)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 30a9b843ef04..945b9a0719dd 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -256,7 +256,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
256 if (!sicode) 256 if (!sicode)
257 force_sig(signr); 257 force_sig(signr);
258 else 258 else
259 force_sig_fault(signr, sicode, addr, tsk); 259 force_sig_fault(signr, sicode, addr, current);
260} 260}
261NOKPROBE_SYMBOL(do_trap); 261NOKPROBE_SYMBOL(do_trap);
262 262
@@ -856,7 +856,7 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr)
856 return; 856 return;
857 857
858 force_sig_fault(SIGFPE, si_code, 858 force_sig_fault(SIGFPE, si_code,
859 (void __user *)uprobe_get_trap_addr(regs), task); 859 (void __user *)uprobe_get_trap_addr(regs), current);
860} 860}
861 861
862dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code) 862dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code)
diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c
index f8f3cfda01ae..68cdcd717c85 100644
--- a/arch/x86/kernel/umip.c
+++ b/arch/x86/kernel/umip.c
@@ -277,7 +277,7 @@ static void force_sig_info_umip_fault(void __user *addr, struct pt_regs *regs)
277 tsk->thread.error_code = X86_PF_USER | X86_PF_WRITE; 277 tsk->thread.error_code = X86_PF_USER | X86_PF_WRITE;
278 tsk->thread.trap_nr = X86_TRAP_PF; 278 tsk->thread.trap_nr = X86_TRAP_PF;
279 279
280 force_sig_fault(SIGSEGV, SEGV_MAPERR, addr, tsk); 280 force_sig_fault(SIGSEGV, SEGV_MAPERR, addr, current);
281 281
282 if (!(show_unhandled_signals && unhandled_signal(tsk, SIGSEGV))) 282 if (!(show_unhandled_signals && unhandled_signal(tsk, SIGSEGV)))
283 return; 283 return;
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index c431326ee3fa..16a5d1b615a7 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -757,7 +757,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
757 757
758 /* XXX: hwpoison faults will set the wrong code. */ 758 /* XXX: hwpoison faults will set the wrong code. */
759 force_sig_fault(signal, si_code, (void __user *)address, 759 force_sig_fault(signal, si_code, (void __user *)address,
760 tsk); 760 current);
761 } 761 }
762 762
763 /* 763 /*
@@ -918,7 +918,7 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
918 if (si_code == SEGV_PKUERR) 918 if (si_code == SEGV_PKUERR)
919 force_sig_pkuerr((void __user *)address, pkey); 919 force_sig_pkuerr((void __user *)address, pkey);
920 920
921 force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); 921 force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
922 922
923 return; 923 return;
924 } 924 }
@@ -1044,7 +1044,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
1044 return; 1044 return;
1045 } 1045 }
1046#endif 1046#endif
1047 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); 1047 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
1048} 1048}
1049 1049
1050static noinline void 1050static noinline void