Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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
...

+567 -484
+2 -2
arch/alpha/kernel/signal.c
··· 225 225 return; 226 226 227 227 give_sigsegv: 228 - force_sig(SIGSEGV, current); 228 + force_sig(SIGSEGV); 229 229 } 230 230 231 231 asmlinkage void ··· 253 253 return; 254 254 255 255 give_sigsegv: 256 - force_sig(SIGSEGV, current); 256 + force_sig(SIGSEGV); 257 257 } 258 258 259 259
+1 -1
arch/alpha/kernel/traps.c
··· 402 402 { 403 403 die_if_kernel("Instruction fault", regs, 0, NULL); 404 404 405 - force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0, current); 405 + force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0); 406 406 } 407 407 408 408
+2 -2
arch/alpha/mm/fault.c
··· 221 221 up_read(&mm->mmap_sem); 222 222 /* Send a sigbus, regardless of whether we were in kernel 223 223 or user mode. */ 224 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address, 0, current); 224 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address, 0); 225 225 if (!user_mode(regs)) 226 226 goto no_context; 227 227 return; 228 228 229 229 do_sigsegv: 230 - force_sig_fault(SIGSEGV, si_code, (void __user *) address, 0, current); 230 + force_sig_fault(SIGSEGV, si_code, (void __user *) address, 0); 231 231 return; 232 232 233 233 #ifdef CONFIG_ALPHA_LARGE_VMALLOC
+2 -2
arch/arc/kernel/process.c
··· 97 97 goto again; 98 98 99 99 fail: 100 - force_sig(SIGSEGV, current); 100 + force_sig(SIGSEGV); 101 101 return ret; 102 102 } 103 103 ··· 310 310 eflags = x->e_flags; 311 311 if ((eflags & EF_ARC_OSABI_MSK) != EF_ARC_OSABI_CURRENT) { 312 312 pr_err("ABI mismatch - you need newer toolchain\n"); 313 - force_sigsegv(SIGSEGV, current); 313 + force_sigsegv(SIGSEGV); 314 314 return 0; 315 315 } 316 316
+1 -1
arch/arc/kernel/signal.c
··· 194 194 return regs->r0; 195 195 196 196 badframe: 197 - force_sig(SIGSEGV, current); 197 + force_sig(SIGSEGV); 198 198 return 0; 199 199 } 200 200
+1 -1
arch/arc/kernel/traps.c
··· 47 47 48 48 tsk->thread.fault_address = (__force unsigned int)addr; 49 49 50 - force_sig_fault(signo, si_code, addr, tsk); 50 + force_sig_fault(signo, si_code, addr); 51 51 52 52 } else { 53 53 /* If not due to copy_(to|from)_user, we are doomed */
+2 -2
arch/arc/mm/fault.c
··· 196 196 /* User mode accesses just cause a SIGSEGV */ 197 197 if (user_mode(regs)) { 198 198 tsk->thread.fault_address = address; 199 - force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); 199 + force_sig_fault(SIGSEGV, si_code, (void __user *)address); 200 200 return; 201 201 } 202 202 ··· 231 231 goto no_context; 232 232 233 233 tsk->thread.fault_address = address; 234 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); 234 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 235 235 }
+1 -1
arch/arm/include/asm/traps.h
··· 30 30 31 31 extern void __init early_trap_init(void *); 32 32 extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); 33 - extern void ptrace_break(struct task_struct *tsk, struct pt_regs *regs); 33 + extern void ptrace_break(struct pt_regs *regs); 34 34 35 35 extern void *vectors_page; 36 36
+3 -3
arch/arm/kernel/ptrace.c
··· 198 198 /* 199 199 * Handle hitting a breakpoint. 200 200 */ 201 - void ptrace_break(struct task_struct *tsk, struct pt_regs *regs) 201 + void ptrace_break(struct pt_regs *regs) 202 202 { 203 203 force_sig_fault(SIGTRAP, TRAP_BRKPT, 204 - (void __user *)instruction_pointer(regs), tsk); 204 + (void __user *)instruction_pointer(regs)); 205 205 } 206 206 207 207 static int break_trap(struct pt_regs *regs, unsigned int instr) 208 208 { 209 - ptrace_break(current, regs); 209 + ptrace_break(regs); 210 210 return 0; 211 211 } 212 212
+2 -2
arch/arm/kernel/signal.c
··· 247 247 return regs->ARM_r0; 248 248 249 249 badframe: 250 - force_sig(SIGSEGV, current); 250 + force_sig(SIGSEGV); 251 251 return 0; 252 252 } 253 253 ··· 280 280 return regs->ARM_r0; 281 281 282 282 badframe: 283 - force_sig(SIGSEGV, current); 283 + force_sig(SIGSEGV); 284 284 return 0; 285 285 } 286 286
+2 -2
arch/arm/kernel/traps.c
··· 369 369 current->thread.error_code = err; 370 370 current->thread.trap_no = trap; 371 371 372 - force_sig_fault(signo, si_code, addr, current); 372 + force_sig_fault(signo, si_code, addr); 373 373 } else { 374 374 die(str, regs, err); 375 375 } ··· 603 603 604 604 case NR(breakpoint): /* SWI BREAK_POINT */ 605 605 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; 606 - ptrace_break(current, regs); 606 + ptrace_break(regs); 607 607 return regs->ARM_r0; 608 608 609 609 /*
+1 -1
arch/arm/mm/alignment.c
··· 945 945 goto fixup; 946 946 947 947 if (ai_usermode & UM_SIGNAL) { 948 - force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr, current); 948 + force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr); 949 949 } else { 950 950 /* 951 951 * We're about to disable the alignment trap and return to
+7 -6
arch/arm/mm/fault.c
··· 154 154 * User mode accesses just cause a SIGSEGV 155 155 */ 156 156 static void 157 - __do_user_fault(struct task_struct *tsk, unsigned long addr, 158 - unsigned int fsr, unsigned int sig, int code, 159 - struct pt_regs *regs) 157 + __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, 158 + int code, struct pt_regs *regs) 160 159 { 160 + struct task_struct *tsk = current; 161 + 161 162 if (addr > TASK_SIZE) 162 163 harden_branch_predictor(); 163 164 ··· 182 181 tsk->thread.address = addr; 183 182 tsk->thread.error_code = fsr; 184 183 tsk->thread.trap_no = 14; 185 - force_sig_fault(sig, code, (void __user *)addr, tsk); 184 + force_sig_fault(sig, code, (void __user *)addr); 186 185 } 187 186 188 187 void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ··· 195 194 * have no context to handle this fault with. 196 195 */ 197 196 if (user_mode(regs)) 198 - __do_user_fault(tsk, addr, fsr, SIGSEGV, SEGV_MAPERR, regs); 197 + __do_user_fault(addr, fsr, SIGSEGV, SEGV_MAPERR, regs); 199 198 else 200 199 __do_kernel_fault(mm, addr, fsr, regs); 201 200 } ··· 391 390 SEGV_ACCERR : SEGV_MAPERR; 392 391 } 393 392 394 - __do_user_fault(tsk, addr, fsr, sig, code, regs); 393 + __do_user_fault(addr, fsr, sig, code, regs); 395 394 return 0; 396 395 397 396 no_context:
+3 -3
arch/arm64/kernel/traps.c
··· 233 233 { 234 234 arm64_show_signal(signo, str); 235 235 if (signo == SIGKILL) 236 - force_sig(SIGKILL, current); 236 + force_sig(SIGKILL); 237 237 else 238 - force_sig_fault(signo, code, addr, current); 238 + force_sig_fault(signo, code, addr); 239 239 } 240 240 241 241 void arm64_force_sig_mceerr(int code, void __user *addr, short lsb, 242 242 const char *str) 243 243 { 244 244 arm64_show_signal(SIGBUS, str); 245 - force_sig_mceerr(code, addr, lsb, current); 245 + force_sig_mceerr(code, addr, lsb); 246 246 } 247 247 248 248 void arm64_force_sig_ptrace_errno_trap(int errno, void __user *addr,
+1 -1
arch/c6x/kernel/signal.c
··· 90 90 return regs->a4; 91 91 92 92 badframe: 93 - force_sig(SIGSEGV, current); 93 + force_sig(SIGSEGV); 94 94 return 0; 95 95 } 96 96
+1 -1
arch/c6x/kernel/traps.c
··· 250 250 die_if_kernel(except_info->kernel_str, regs, addr); 251 251 252 252 force_sig_fault(except_info->signo, except_info->code, 253 - (void __user *)addr, current); 253 + (void __user *)addr); 254 254 } 255 255 256 256 /*
+1 -1
arch/csky/abiv1/alignment.c
··· 283 283 do_exit(SIGKILL); 284 284 } 285 285 286 - force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr, current); 286 + force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr); 287 287 } 288 288 289 289 static struct ctl_table alignment_tbl[4] = {
+1 -1
arch/csky/abiv2/fpu.c
··· 124 124 code = FPE_FLTRES; 125 125 } 126 126 127 - force_sig_fault(sig, code, (void __user *)regs->pc, current); 127 + force_sig_fault(sig, code, (void __user *)regs->pc); 128 128 } 129 129 130 130 #define FMFVR_FPU_REGS(vrx, vry) \
+1 -3
arch/csky/kernel/signal.c
··· 66 66 { 67 67 struct pt_regs *regs = current_pt_regs(); 68 68 struct rt_sigframe __user *frame; 69 - struct task_struct *task; 70 69 sigset_t set; 71 70 72 71 /* Always make any pending restarted system calls return -EINTR */ ··· 90 91 return regs->a0; 91 92 92 93 badframe: 93 - task = current; 94 - force_sig(SIGSEGV, task); 94 + force_sig(SIGSEGV); 95 95 return 0; 96 96 } 97 97
+1 -1
arch/csky/kernel/traps.c
··· 106 106 pr_err("User mode Bus Error\n"); 107 107 show_regs(regs); 108 108 109 - force_sig_fault(SIGSEGV, 0, (void __user *)regs->pc, current); 109 + force_sig_fault(SIGSEGV, 0, (void __user *)regs->pc); 110 110 } 111 111 112 112 #define USR_BKPT 0x1464
+2 -2
arch/csky/mm/fault.c
··· 179 179 bad_area_nosemaphore: 180 180 /* User mode accesses just cause a SIGSEGV */ 181 181 if (user_mode(regs)) { 182 - force_sig_fault(SIGSEGV, si_code, (void __user *)address, current); 182 + force_sig_fault(SIGSEGV, si_code, (void __user *)address); 183 183 return; 184 184 } 185 185 ··· 212 212 if (!user_mode(regs)) 213 213 goto no_context; 214 214 215 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current); 215 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 216 216 }
+2 -2
arch/h8300/kernel/ptrace_h.c
··· 250 250 { 251 251 if ((unsigned long)current->thread.breakinfo.addr == bp) { 252 252 user_disable_single_step(current); 253 - force_sig(SIGTRAP, current); 253 + force_sig(SIGTRAP); 254 254 } else 255 - force_sig(SIGILL, current); 255 + force_sig(SIGILL); 256 256 }
+1 -1
arch/h8300/kernel/ptrace_s.c
··· 40 40 asmlinkage void trace_trap(unsigned long bp) 41 41 { 42 42 (void)bp; 43 - force_sig(SIGTRAP, current); 43 + force_sig(SIGTRAP); 44 44 }
+1 -1
arch/h8300/kernel/signal.c
··· 126 126 return er0; 127 127 128 128 badframe: 129 - force_sig(SIGSEGV, current); 129 + force_sig(SIGSEGV); 130 130 return 0; 131 131 } 132 132
+1 -1
arch/hexagon/kernel/signal.c
··· 252 252 return regs->r00; 253 253 254 254 badframe: 255 - force_sig(SIGSEGV, current); 255 + force_sig(SIGSEGV); 256 256 return 0; 257 257 }
+6 -6
arch/hexagon/kernel/traps.c
··· 239 239 static void misaligned_instruction(struct pt_regs *regs) 240 240 { 241 241 die_if_kernel("Misaligned Instruction", regs, 0); 242 - force_sig(SIGBUS, current); 242 + force_sig(SIGBUS); 243 243 } 244 244 245 245 /* ··· 250 250 static void misaligned_data_load(struct pt_regs *regs) 251 251 { 252 252 die_if_kernel("Misaligned Data Load", regs, 0); 253 - force_sig(SIGBUS, current); 253 + force_sig(SIGBUS); 254 254 } 255 255 256 256 static void misaligned_data_store(struct pt_regs *regs) 257 257 { 258 258 die_if_kernel("Misaligned Data Store", regs, 0); 259 - force_sig(SIGBUS, current); 259 + force_sig(SIGBUS); 260 260 } 261 261 262 262 static void illegal_instruction(struct pt_regs *regs) 263 263 { 264 264 die_if_kernel("Illegal Instruction", regs, 0); 265 - force_sig(SIGILL, current); 265 + force_sig(SIGILL); 266 266 } 267 267 268 268 /* ··· 272 272 static void precise_bus_error(struct pt_regs *regs) 273 273 { 274 274 die_if_kernel("Precise Bus Error", regs, 0); 275 - force_sig(SIGBUS, current); 275 + force_sig(SIGBUS); 276 276 } 277 277 278 278 /* ··· 407 407 * may want to use a different trap0 flavor. 408 408 */ 409 409 force_sig_fault(SIGTRAP, TRAP_BRKPT, 410 - (void __user *) pt_elr(regs), current); 410 + (void __user *) pt_elr(regs)); 411 411 } else { 412 412 #ifdef CONFIG_KGDB 413 413 kgdb_handle_exception(pt_cause(regs), SIGTRAP,
+2 -2
arch/hexagon/mm/vm_fault.c
··· 135 135 si_signo = SIGSEGV; 136 136 si_code = SEGV_ACCERR; 137 137 } 138 - force_sig_fault(si_signo, si_code, (void __user *)address, current); 138 + force_sig_fault(si_signo, si_code, (void __user *)address); 139 139 return; 140 140 141 141 bad_area: 142 142 up_read(&mm->mmap_sem); 143 143 144 144 if (user_mode(regs)) { 145 - force_sig_fault(SIGSEGV, si_code, (void __user *)address, current); 145 + force_sig_fault(SIGSEGV, si_code, (void __user *)address); 146 146 return; 147 147 } 148 148 /* Kernel-mode fault falls through */
+3 -3
arch/ia64/kernel/brl_emu.c
··· 197 197 */ 198 198 printk(KERN_DEBUG "Woah! Unimplemented Instruction Address Trap!\n"); 199 199 force_sig_fault(SIGILL, ILL_BADIADDR, (void __user *)NULL, 200 - 0, 0, 0, current); 200 + 0, 0, 0); 201 201 } else if (ia64_psr(regs)->tb) { 202 202 /* 203 203 * Branch Tracing is enabled. 204 204 * Force a taken branch signal. 205 205 */ 206 206 force_sig_fault(SIGTRAP, TRAP_BRANCH, (void __user *)NULL, 207 - 0, 0, 0, current); 207 + 0, 0, 0); 208 208 } else if (ia64_psr(regs)->ss) { 209 209 /* 210 210 * Single Step is enabled. 211 211 * Force a trace signal. 212 212 */ 213 213 force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)NULL, 214 - 0, 0, 0, current); 214 + 0, 0, 0); 215 215 } 216 216 return rv; 217 217 }
+4 -4
arch/ia64/kernel/signal.c
··· 152 152 return retval; 153 153 154 154 give_sigsegv: 155 - force_sig(SIGSEGV, current); 155 + force_sig(SIGSEGV); 156 156 return retval; 157 157 } 158 158 ··· 257 257 */ 258 258 check_sp = (new_sp - sizeof(*frame)) & -STACK_ALIGN; 259 259 if (!likely(on_sig_stack(check_sp))) { 260 - force_sigsegv(ksig->sig, current); 260 + force_sigsegv(ksig->sig); 261 261 return 1; 262 262 } 263 263 } ··· 265 265 frame = (void __user *) ((new_sp - sizeof(*frame)) & -STACK_ALIGN); 266 266 267 267 if (!access_ok(frame, sizeof(*frame))) { 268 - force_sigsegv(ksig->sig, current); 268 + force_sigsegv(ksig->sig); 269 269 return 1; 270 270 } 271 271 ··· 282 282 err |= setup_sigcontext(&frame->sc, set, scr); 283 283 284 284 if (unlikely(err)) { 285 - force_sigsegv(ksig->sig, current); 285 + force_sigsegv(ksig->sig); 286 286 return 1; 287 287 } 288 288
+12 -12
arch/ia64/kernel/traps.c
··· 176 176 } 177 177 force_sig_fault(sig, code, 178 178 (void __user *) (regs->cr_iip + ia64_psr(regs)->ri), 179 - break_num, 0 /* clear __ISR_VALID */, 0, current); 179 + break_num, 0 /* clear __ISR_VALID */, 0); 180 180 } 181 181 182 182 /* ··· 353 353 } 354 354 force_sig_fault(SIGFPE, si_code, 355 355 (void __user *) (regs->cr_iip + ia64_psr(regs)->ri), 356 - 0, __ISR_VALID, isr, current); 356 + 0, __ISR_VALID, isr); 357 357 } 358 358 } else { 359 359 if (exception == -1) { ··· 373 373 } 374 374 force_sig_fault(SIGFPE, si_code, 375 375 (void __user *) (regs->cr_iip + ia64_psr(regs)->ri), 376 - 0, __ISR_VALID, isr, current); 376 + 0, __ISR_VALID, isr); 377 377 } 378 378 } 379 379 return 0; ··· 408 408 409 409 force_sig_fault(SIGILL, ILL_ILLOPC, 410 410 (void __user *) (regs.cr_iip + ia64_psr(&regs)->ri), 411 - 0, 0, 0, current); 411 + 0, 0, 0); 412 412 return rv; 413 413 } 414 414 ··· 483 483 + ia64_psr(&regs)->ri); 484 484 } 485 485 force_sig_fault(sig, code, addr, 486 - vector, __ISR_VALID, isr, current); 486 + vector, __ISR_VALID, isr); 487 487 return; 488 488 } else if (ia64_done_with_exception(&regs)) 489 489 return; ··· 493 493 case 31: /* Unsupported Data Reference */ 494 494 if (user_mode(&regs)) { 495 495 force_sig_fault(SIGILL, ILL_ILLOPN, (void __user *) iip, 496 - vector, __ISR_VALID, isr, current); 496 + vector, __ISR_VALID, isr); 497 497 return; 498 498 } 499 499 sprintf(buf, "Unsupported data reference"); ··· 542 542 == NOTIFY_STOP) 543 543 return; 544 544 force_sig_fault(SIGTRAP, si_code, (void __user *) ifa, 545 - 0, __ISR_VALID, isr, current); 545 + 0, __ISR_VALID, isr); 546 546 return; 547 547 548 548 case 32: /* fp fault */ ··· 550 550 result = handle_fpu_swa((vector == 32) ? 1 : 0, &regs, isr); 551 551 if ((result < 0) || (current->thread.flags & IA64_THREAD_FPEMU_SIGFPE)) { 552 552 force_sig_fault(SIGFPE, FPE_FLTINV, (void __user *) iip, 553 - 0, __ISR_VALID, isr, current); 553 + 0, __ISR_VALID, isr); 554 554 } 555 555 return; 556 556 ··· 578 578 if (user_mode(&regs)) { 579 579 force_sig_fault(SIGILL, ILL_BADIADDR, 580 580 (void __user *) iip, 581 - 0, 0, 0, current); 581 + 0, 0, 0); 582 582 return; 583 583 } 584 584 sprintf(buf, "Unimplemented Instruction Address fault"); ··· 589 589 printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n"); 590 590 printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n", 591 591 iip, ifa, isr); 592 - force_sig(SIGSEGV, current); 592 + force_sig(SIGSEGV); 593 593 return; 594 594 595 595 case 46: 596 596 printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n"); 597 597 printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n", 598 598 iip, ifa, isr, iim); 599 - force_sig(SIGSEGV, current); 599 + force_sig(SIGSEGV); 600 600 return; 601 601 602 602 case 47: ··· 608 608 break; 609 609 } 610 610 if (!die_if_kernel(buf, &regs, error)) 611 - force_sig(SIGILL, current); 611 + force_sig(SIGILL); 612 612 }
+1 -1
arch/ia64/kernel/unaligned.c
··· 1537 1537 } 1538 1538 force_sigbus: 1539 1539 force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) ifa, 1540 - 0, 0, 0, current); 1540 + 0, 0, 0); 1541 1541 goto done; 1542 1542 }
+1 -1
arch/ia64/mm/fault.c
··· 249 249 } 250 250 if (user_mode(regs)) { 251 251 force_sig_fault(signal, code, (void __user *) address, 252 - 0, __ISR_VALID, isr, current); 252 + 0, __ISR_VALID, isr); 253 253 return; 254 254 } 255 255
+2 -2
arch/m68k/kernel/signal.c
··· 803 803 return regs->d0; 804 804 805 805 badframe: 806 - force_sig(SIGSEGV, current); 806 + force_sig(SIGSEGV); 807 807 return 0; 808 808 } 809 809 ··· 825 825 return regs->d0; 826 826 827 827 badframe: 828 - force_sig(SIGSEGV, current); 828 + force_sig(SIGSEGV); 829 829 return 0; 830 830 } 831 831
+10 -10
arch/m68k/kernel/traps.c
··· 431 431 pr_err("BAD KERNEL BUSERR\n"); 432 432 433 433 die_if_kernel("Oops", &fp->ptregs,0); 434 - force_sig(SIGKILL, current); 434 + force_sig(SIGKILL); 435 435 return; 436 436 } 437 437 } else { ··· 463 463 !(ssw & RW) ? "write" : "read", addr, 464 464 fp->ptregs.pc); 465 465 die_if_kernel ("Oops", &fp->ptregs, buserr_type); 466 - force_sig (SIGBUS, current); 466 + force_sig (SIGBUS); 467 467 return; 468 468 } 469 469 ··· 493 493 do_page_fault (&fp->ptregs, addr, 0); 494 494 } else { 495 495 pr_debug("protection fault on insn access (segv).\n"); 496 - force_sig (SIGSEGV, current); 496 + force_sig (SIGSEGV); 497 497 } 498 498 } 499 499 #else ··· 571 571 !(ssw & RW) ? "write" : "read", addr, 572 572 fp->ptregs.pc); 573 573 die_if_kernel("Oops",&fp->ptregs,mmusr); 574 - force_sig(SIGSEGV, current); 574 + force_sig(SIGSEGV); 575 575 return; 576 576 } else { 577 577 #if 0 ··· 598 598 #endif 599 599 pr_debug("Unknown SIGSEGV - 1\n"); 600 600 die_if_kernel("Oops",&fp->ptregs,mmusr); 601 - force_sig(SIGSEGV, current); 601 + force_sig(SIGSEGV); 602 602 return; 603 603 } 604 604 ··· 621 621 buserr: 622 622 pr_err("BAD KERNEL BUSERR\n"); 623 623 die_if_kernel("Oops",&fp->ptregs,0); 624 - force_sig(SIGKILL, current); 624 + force_sig(SIGKILL); 625 625 return; 626 626 } 627 627 ··· 660 660 addr, fp->ptregs.pc); 661 661 pr_debug("Unknown SIGSEGV - 2\n"); 662 662 die_if_kernel("Oops",&fp->ptregs,mmusr); 663 - force_sig(SIGSEGV, current); 663 + force_sig(SIGSEGV); 664 664 return; 665 665 } 666 666 ··· 804 804 default: 805 805 die_if_kernel("bad frame format",&fp->ptregs,0); 806 806 pr_debug("Unknown SIGSEGV - 4\n"); 807 - force_sig(SIGSEGV, current); 807 + force_sig(SIGSEGV); 808 808 } 809 809 } 810 810 ··· 1127 1127 addr = (void __user*) fp->un.fmtb.daddr; 1128 1128 break; 1129 1129 } 1130 - force_sig_fault(sig, si_code, addr, current); 1130 + force_sig_fault(sig, si_code, addr); 1131 1131 } 1132 1132 1133 1133 void die_if_kernel (char *str, struct pt_regs *fp, int nr) ··· 1159 1159 #ifdef CONFIG_M68KFPU_EMU 1160 1160 asmlinkage void fpemu_signal(int signal, int code, void *addr) 1161 1161 { 1162 - force_sig_fault(signal, code, addr, current); 1162 + force_sig_fault(signal, code, addr); 1163 1163 } 1164 1164 #endif
+2 -2
arch/m68k/mm/fault.c
··· 30 30 pr_debug("send_fault_sig: %p,%d,%d\n", addr, signo, si_code); 31 31 32 32 if (user_mode(regs)) { 33 - force_sig_fault(signo, si_code, addr, current); 33 + force_sig_fault(signo, si_code, addr); 34 34 } else { 35 35 if (fixup_exception(regs)) 36 36 return -1; 37 37 38 38 //if (signo == SIGBUS) 39 - // force_sig_fault(si_signo, si_code, addr, current); 39 + // force_sig_fault(si_signo, si_code, addr); 40 40 41 41 /* 42 42 * Oops. The kernel tried to access some bad page. We'll have to
+1 -1
arch/microblaze/kernel/exceptions.c
··· 63 63 if (kernel_mode(regs)) 64 64 die("Exception in kernel mode", regs, signr); 65 65 66 - force_sig_fault(signr, code, (void __user *)addr, current); 66 + force_sig_fault(signr, code, (void __user *)addr); 67 67 } 68 68 69 69 asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
+1 -1
arch/microblaze/kernel/signal.c
··· 108 108 return rval; 109 109 110 110 badframe: 111 - force_sig(SIGSEGV, current); 111 + force_sig(SIGSEGV); 112 112 return 0; 113 113 } 114 114
+1 -1
arch/microblaze/mm/fault.c
··· 289 289 do_sigbus: 290 290 up_read(&mm->mmap_sem); 291 291 if (user_mode(regs)) { 292 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current); 292 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 293 293 return; 294 294 } 295 295 bad_page_fault(regs, address, SIGBUS);
+9 -9
arch/mips/kernel/branch.c
··· 32 32 /* Calculate exception PC in branch delay slot. */ 33 33 if (__get_user(inst, (u16 __user *) msk_isa16_mode(epc))) { 34 34 /* This should never happen because delay slot was checked. */ 35 - force_sig(SIGSEGV, current); 35 + force_sig(SIGSEGV); 36 36 return epc; 37 37 } 38 38 if (cpu_has_mips16) { ··· 305 305 return 0; 306 306 307 307 sigsegv: 308 - force_sig(SIGSEGV, current); 308 + force_sig(SIGSEGV); 309 309 return -EFAULT; 310 310 } 311 311 ··· 328 328 /* Read the instruction. */ 329 329 addr = (u16 __user *)msk_isa16_mode(epc); 330 330 if (__get_user(inst.full, addr)) { 331 - force_sig(SIGSEGV, current); 331 + force_sig(SIGSEGV); 332 332 return -EFAULT; 333 333 } 334 334 ··· 343 343 case MIPS16e_jal_op: 344 344 addr += 1; 345 345 if (__get_user(inst2, addr)) { 346 - force_sig(SIGSEGV, current); 346 + force_sig(SIGSEGV); 347 347 return -EFAULT; 348 348 } 349 349 fullinst = ((unsigned)inst.full << 16) | inst2; ··· 829 829 sigill_dsp: 830 830 pr_debug("%s: DSP branch but not DSP ASE - sending SIGILL.\n", 831 831 current->comm); 832 - force_sig(SIGILL, current); 832 + force_sig(SIGILL); 833 833 return -EFAULT; 834 834 sigill_r2r6: 835 835 pr_debug("%s: R2 branch but r2-to-r6 emulator is not present - sending SIGILL.\n", 836 836 current->comm); 837 - force_sig(SIGILL, current); 837 + force_sig(SIGILL); 838 838 return -EFAULT; 839 839 sigill_r6: 840 840 pr_debug("%s: R6 branch but no MIPSr6 ISA support - sending SIGILL.\n", 841 841 current->comm); 842 - force_sig(SIGILL, current); 842 + force_sig(SIGILL); 843 843 return -EFAULT; 844 844 } 845 845 EXPORT_SYMBOL_GPL(__compute_return_epc_for_insn); ··· 859 859 */ 860 860 addr = (unsigned int __user *) epc; 861 861 if (__get_user(insn.word, addr)) { 862 - force_sig(SIGSEGV, current); 862 + force_sig(SIGSEGV); 863 863 return -EFAULT; 864 864 } 865 865 ··· 867 867 868 868 unaligned: 869 869 printk("%s: unaligned epc - sending SIGBUS.\n", current->comm); 870 - force_sig(SIGBUS, current); 870 + force_sig(SIGBUS); 871 871 return -EFAULT; 872 872 } 873 873
+1 -1
arch/mips/kernel/kprobes.c
··· 220 220 221 221 unaligned: 222 222 pr_notice("%s: unaligned epc - sending SIGBUS.\n", current->comm); 223 - force_sig(SIGBUS, current); 223 + force_sig(SIGBUS); 224 224 return -EFAULT; 225 225 226 226 }
+4 -4
arch/mips/kernel/signal.c
··· 641 641 if (sig < 0) 642 642 goto badframe; 643 643 else if (sig) 644 - force_sig(sig, current); 644 + force_sig(sig); 645 645 646 646 /* 647 647 * Don't let your children do this ... ··· 654 654 /* Unreached */ 655 655 656 656 badframe: 657 - force_sig(SIGSEGV, current); 657 + force_sig(SIGSEGV); 658 658 } 659 659 #endif /* CONFIG_TRAD_SIGNALS */ 660 660 ··· 678 678 if (sig < 0) 679 679 goto badframe; 680 680 else if (sig) 681 - force_sig(sig, current); 681 + force_sig(sig); 682 682 683 683 if (restore_altstack(&frame->rs_uc.uc_stack)) 684 684 goto badframe; ··· 694 694 /* Unreached */ 695 695 696 696 badframe: 697 - force_sig(SIGSEGV, current); 697 + force_sig(SIGSEGV); 698 698 } 699 699 700 700 #ifdef CONFIG_TRAD_SIGNALS
+2 -2
arch/mips/kernel/signal_n32.c
··· 71 71 if (sig < 0) 72 72 goto badframe; 73 73 else if (sig) 74 - force_sig(sig, current); 74 + force_sig(sig); 75 75 76 76 if (compat_restore_altstack(&frame->rs_uc.uc_stack)) 77 77 goto badframe; ··· 87 87 /* Unreached */ 88 88 89 89 badframe: 90 - force_sig(SIGSEGV, current); 90 + force_sig(SIGSEGV); 91 91 } 92 92 93 93 static int setup_rt_frame_n32(void *sig_return, struct ksignal *ksig,
+4 -4
arch/mips/kernel/signal_o32.c
··· 171 171 if (sig < 0) 172 172 goto badframe; 173 173 else if (sig) 174 - force_sig(sig, current); 174 + force_sig(sig); 175 175 176 176 if (compat_restore_altstack(&frame->rs_uc.uc_stack)) 177 177 goto badframe; ··· 187 187 /* Unreached */ 188 188 189 189 badframe: 190 - force_sig(SIGSEGV, current); 190 + force_sig(SIGSEGV); 191 191 } 192 192 193 193 static int setup_rt_frame_32(void *sig_return, struct ksignal *ksig, ··· 273 273 if (sig < 0) 274 274 goto badframe; 275 275 else if (sig) 276 - force_sig(sig, current); 276 + force_sig(sig); 277 277 278 278 /* 279 279 * Don't let your children do this ... ··· 286 286 /* Unreached */ 287 287 288 288 badframe: 289 - force_sig(SIGSEGV, current); 289 + force_sig(SIGSEGV); 290 290 }
+25 -25
arch/mips/kernel/traps.c
··· 482 482 goto out; 483 483 484 484 die_if_kernel("Oops", regs); 485 - force_sig(SIGBUS, current); 485 + force_sig(SIGBUS); 486 486 487 487 out: 488 488 exception_exit(prev_state); ··· 705 705 prev_state = exception_enter(); 706 706 die_if_kernel("Integer overflow", regs); 707 707 708 - force_sig_fault(SIGFPE, FPE_INTOVF, (void __user *)regs->cp0_epc, current); 708 + force_sig_fault(SIGFPE, FPE_INTOVF, (void __user *)regs->cp0_epc); 709 709 exception_exit(prev_state); 710 710 } 711 711 ··· 733 733 else if (fcr31 & FPU_CSR_INE_X) 734 734 si_code = FPE_FLTRES; 735 735 736 - force_sig_fault(SIGFPE, si_code, fault_addr, tsk); 736 + force_sig_fault_to_task(SIGFPE, si_code, fault_addr, tsk); 737 737 } 738 738 739 739 int process_fpemu_return(int sig, void __user *fault_addr, unsigned long fcr31) ··· 750 750 return 1; 751 751 752 752 case SIGBUS: 753 - force_sig_fault(SIGBUS, BUS_ADRERR, fault_addr, current); 753 + force_sig_fault(SIGBUS, BUS_ADRERR, fault_addr); 754 754 return 1; 755 755 756 756 case SIGSEGV: ··· 761 761 else 762 762 si_code = SEGV_MAPERR; 763 763 up_read(&current->mm->mmap_sem); 764 - force_sig_fault(SIGSEGV, si_code, fault_addr, current); 764 + force_sig_fault(SIGSEGV, si_code, fault_addr); 765 765 return 1; 766 766 767 767 default: 768 - force_sig(sig, current); 768 + force_sig(sig); 769 769 return 1; 770 770 } 771 771 } ··· 943 943 die_if_kernel(b, regs); 944 944 force_sig_fault(SIGFPE, 945 945 code == BRK_DIVZERO ? FPE_INTDIV : FPE_INTOVF, 946 - (void __user *) regs->cp0_epc, current); 946 + (void __user *) regs->cp0_epc); 947 947 break; 948 948 case BRK_BUG: 949 949 die_if_kernel("Kernel bug detected", regs); 950 - force_sig(SIGTRAP, current); 950 + force_sig(SIGTRAP); 951 951 break; 952 952 case BRK_MEMU: 953 953 /* ··· 962 962 return; 963 963 964 964 die_if_kernel("Math emu break/trap", regs); 965 - force_sig(SIGTRAP, current); 965 + force_sig(SIGTRAP); 966 966 break; 967 967 default: 968 968 scnprintf(b, sizeof(b), "%s instruction in kernel code", str); 969 969 die_if_kernel(b, regs); 970 970 if (si_code) { 971 - force_sig_fault(SIGTRAP, si_code, NULL, current); 971 + force_sig_fault(SIGTRAP, si_code, NULL); 972 972 } else { 973 - force_sig(SIGTRAP, current); 973 + force_sig(SIGTRAP); 974 974 } 975 975 } 976 976 } ··· 1063 1063 return; 1064 1064 1065 1065 out_sigsegv: 1066 - force_sig(SIGSEGV, current); 1066 + force_sig(SIGSEGV); 1067 1067 goto out; 1068 1068 } 1069 1069 ··· 1105 1105 return; 1106 1106 1107 1107 out_sigsegv: 1108 - force_sig(SIGSEGV, current); 1108 + force_sig(SIGSEGV); 1109 1109 goto out; 1110 1110 } 1111 1111 ··· 1191 1191 if (unlikely(status > 0)) { 1192 1192 regs->cp0_epc = old_epc; /* Undo skip-over. */ 1193 1193 regs->regs[31] = old31; 1194 - force_sig(status, current); 1194 + force_sig(status); 1195 1195 } 1196 1196 1197 1197 out: ··· 1220 1220 1221 1221 die_if_kernel("COP2: Unhandled kernel unaligned access or invalid " 1222 1222 "instruction", regs); 1223 - force_sig(SIGILL, current); 1223 + force_sig(SIGILL); 1224 1224 1225 1225 return NOTIFY_OK; 1226 1226 } ··· 1383 1383 if (unlikely(status > 0)) { 1384 1384 regs->cp0_epc = old_epc; /* Undo skip-over. */ 1385 1385 regs->regs[31] = old31; 1386 - force_sig(status, current); 1386 + force_sig(status); 1387 1387 } 1388 1388 1389 1389 break; ··· 1403 1403 * emulator too. 1404 1404 */ 1405 1405 if (raw_cpu_has_fpu || !cpu_has_mips_4_5_64_r2_r6) { 1406 - force_sig(SIGILL, current); 1406 + force_sig(SIGILL); 1407 1407 break; 1408 1408 } 1409 1409 /* Fall through. */ ··· 1437 1437 #else /* CONFIG_MIPS_FP_SUPPORT */ 1438 1438 case 1: 1439 1439 case 3: 1440 - force_sig(SIGILL, current); 1440 + force_sig(SIGILL); 1441 1441 break; 1442 1442 #endif /* CONFIG_MIPS_FP_SUPPORT */ 1443 1443 ··· 1464 1464 local_irq_enable(); 1465 1465 1466 1466 die_if_kernel("do_msa_fpe invoked from kernel context!", regs); 1467 - force_sig(SIGFPE, current); 1467 + force_sig(SIGFPE); 1468 1468 out: 1469 1469 exception_exit(prev_state); 1470 1470 } ··· 1477 1477 prev_state = exception_enter(); 1478 1478 1479 1479 if (!cpu_has_msa || test_thread_flag(TIF_32BIT_FPREGS)) { 1480 - force_sig(SIGILL, current); 1480 + force_sig(SIGILL); 1481 1481 goto out; 1482 1482 } 1483 1483 ··· 1485 1485 1486 1486 err = enable_restore_fp_context(1); 1487 1487 if (err) 1488 - force_sig(SIGILL, current); 1488 + force_sig(SIGILL); 1489 1489 out: 1490 1490 exception_exit(prev_state); 1491 1491 } ··· 1495 1495 enum ctx_state prev_state; 1496 1496 1497 1497 prev_state = exception_enter(); 1498 - force_sig(SIGILL, current); 1498 + force_sig(SIGILL); 1499 1499 exception_exit(prev_state); 1500 1500 } 1501 1501 ··· 1521 1521 if (test_tsk_thread_flag(current, TIF_LOAD_WATCH)) { 1522 1522 mips_read_watch_registers(); 1523 1523 local_irq_enable(); 1524 - force_sig_fault(SIGTRAP, TRAP_HWBKPT, NULL, current); 1524 + force_sig_fault(SIGTRAP, TRAP_HWBKPT, NULL); 1525 1525 } else { 1526 1526 mips_clear_watch_registers(); 1527 1527 local_irq_enable(); ··· 1592 1592 } 1593 1593 die_if_kernel("MIPS MT Thread exception in kernel", regs); 1594 1594 1595 - force_sig(SIGILL, current); 1595 + force_sig(SIGILL); 1596 1596 } 1597 1597 1598 1598 ··· 1601 1601 if (cpu_has_dsp) 1602 1602 panic("Unexpected DSP exception"); 1603 1603 1604 - force_sig(SIGILL, current); 1604 + force_sig(SIGILL); 1605 1605 } 1606 1606 1607 1607 asmlinkage void do_reserved(struct pt_regs *regs)
+10 -10
arch/mips/kernel/unaligned.c
··· 1365 1365 return; 1366 1366 1367 1367 die_if_kernel("Unhandled kernel unaligned access", regs); 1368 - force_sig(SIGSEGV, current); 1368 + force_sig(SIGSEGV); 1369 1369 1370 1370 return; 1371 1371 1372 1372 sigbus: 1373 1373 die_if_kernel("Unhandled kernel unaligned access", regs); 1374 - force_sig(SIGBUS, current); 1374 + force_sig(SIGBUS); 1375 1375 1376 1376 return; 1377 1377 1378 1378 sigill: 1379 1379 die_if_kernel 1380 1380 ("Unhandled kernel unaligned access or invalid instruction", regs); 1381 - force_sig(SIGILL, current); 1381 + force_sig(SIGILL); 1382 1382 } 1383 1383 1384 1384 /* Recode table from 16-bit register notation to 32-bit GPR. */ ··· 1991 1991 return; 1992 1992 1993 1993 die_if_kernel("Unhandled kernel unaligned access", regs); 1994 - force_sig(SIGSEGV, current); 1994 + force_sig(SIGSEGV); 1995 1995 1996 1996 return; 1997 1997 1998 1998 sigbus: 1999 1999 die_if_kernel("Unhandled kernel unaligned access", regs); 2000 - force_sig(SIGBUS, current); 2000 + force_sig(SIGBUS); 2001 2001 2002 2002 return; 2003 2003 2004 2004 sigill: 2005 2005 die_if_kernel 2006 2006 ("Unhandled kernel unaligned access or invalid instruction", regs); 2007 - force_sig(SIGILL, current); 2007 + force_sig(SIGILL); 2008 2008 } 2009 2009 2010 2010 static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr) ··· 2271 2271 return; 2272 2272 2273 2273 die_if_kernel("Unhandled kernel unaligned access", regs); 2274 - force_sig(SIGSEGV, current); 2274 + force_sig(SIGSEGV); 2275 2275 2276 2276 return; 2277 2277 2278 2278 sigbus: 2279 2279 die_if_kernel("Unhandled kernel unaligned access", regs); 2280 - force_sig(SIGBUS, current); 2280 + force_sig(SIGBUS); 2281 2281 2282 2282 return; 2283 2283 2284 2284 sigill: 2285 2285 die_if_kernel 2286 2286 ("Unhandled kernel unaligned access or invalid instruction", regs); 2287 - force_sig(SIGILL, current); 2287 + force_sig(SIGILL); 2288 2288 } 2289 2289 2290 2290 asmlinkage void do_ade(struct pt_regs *regs) ··· 2364 2364 2365 2365 sigbus: 2366 2366 die_if_kernel("Kernel unaligned instruction access", regs); 2367 - force_sig(SIGBUS, current); 2367 + force_sig(SIGBUS); 2368 2368 2369 2369 /* 2370 2370 * XXX On return from the signal handler we should advance the epc
+2 -2
arch/mips/mm/fault.c
··· 223 223 pr_cont("\n"); 224 224 } 225 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); 227 227 return; 228 228 } 229 229 ··· 279 279 #endif 280 280 current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f; 281 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); 283 283 284 284 return; 285 285 #ifndef CONFIG_64BIT
+1 -1
arch/mips/sgi-ip22/ip22-berr.c
··· 98 98 field, regs->cp0_epc, field, regs->regs[31]); 99 99 /* Assume it would be too dangerous to continue ... */ 100 100 die_if_kernel("Oops", regs); 101 - force_sig(SIGBUS, current); 101 + force_sig(SIGBUS); 102 102 } 103 103 104 104 static int ip22_be_handler(struct pt_regs *regs, int is_fixup)
+1 -1
arch/mips/sgi-ip22/ip28-berr.c
··· 462 462 if (ip28_be_interrupt(regs) != MIPS_BE_DISCARD) { 463 463 /* Assume it would be too dangerous to continue ... */ 464 464 die_if_kernel("Oops", regs); 465 - force_sig(SIGBUS, current); 465 + force_sig(SIGBUS); 466 466 } else if (debug_be_interrupt) 467 467 show_regs(regs); 468 468 }
+1 -1
arch/mips/sgi-ip27/ip27-berr.c
··· 74 74 show_regs(regs); 75 75 dump_tlb_all(); 76 76 while(1); 77 - force_sig(SIGBUS, current); 77 + force_sig(SIGBUS); 78 78 } 79 79 80 80 void __init ip27_be_init(void)
+1 -1
arch/mips/sgi-ip32/ip32-berr.c
··· 29 29 show_regs(regs); 30 30 dump_tlb_all(); 31 31 while(1); 32 - force_sig(SIGBUS, current); 32 + force_sig(SIGBUS); 33 33 } 34 34 35 35 void __init ip32_be_init(void)
+1 -1
arch/nds32/kernel/fpu.c
··· 243 243 } 244 244 245 245 force_sig_fault(si_signo, si_code, 246 - (void __user *)instruction_pointer(regs), current); 246 + (void __user *)instruction_pointer(regs)); 247 247 done: 248 248 own_fpu(); 249 249 }
+1 -1
arch/nds32/kernel/signal.c
··· 163 163 return regs->uregs[0]; 164 164 165 165 badframe: 166 - force_sig(SIGSEGV, current); 166 + force_sig(SIGSEGV); 167 167 return 0; 168 168 } 169 169
+9 -8
arch/nds32/kernel/traps.c
··· 205 205 } 206 206 207 207 force_sig_fault(SIGILL, ILL_ILLTRP, 208 - (void __user *)instruction_pointer(regs) - 4, current); 208 + (void __user *)instruction_pointer(regs) - 4); 209 209 die_if_kernel("Oops - bad syscall", regs, n); 210 210 return regs->uregs[0]; 211 211 } ··· 255 255 cpu_cache_wbinval_page(base, true); 256 256 } 257 257 258 - void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, 259 - int error_code, int si_code) 258 + static void send_sigtrap(struct pt_regs *regs, int error_code, int si_code) 260 259 { 260 + struct task_struct *tsk = current; 261 + 261 262 tsk->thread.trap_no = ENTRY_DEBUG_RELATED; 262 263 tsk->thread.error_code = error_code; 263 264 264 265 force_sig_fault(SIGTRAP, si_code, 265 - (void __user *)instruction_pointer(regs), tsk); 266 + (void __user *)instruction_pointer(regs)); 266 267 } 267 268 268 269 void do_debug_trap(unsigned long entry, unsigned long addr, ··· 275 274 276 275 if (user_mode(regs)) { 277 276 /* trap_signal */ 278 - send_sigtrap(current, regs, 0, TRAP_BRKPT); 277 + send_sigtrap(regs, 0, TRAP_BRKPT); 279 278 } else { 280 279 /* kernel_trap */ 281 280 if (!fixup_exception(regs)) ··· 289 288 show_regs(regs); 290 289 if (!user_mode(regs)) 291 290 do_exit(SIGKILL); 292 - force_sig(SIGKILL, current); 291 + force_sig(SIGKILL); 293 292 } 294 293 295 294 void unhandled_exceptions(unsigned long entry, unsigned long addr, ··· 300 299 show_regs(regs); 301 300 if (!user_mode(regs)) 302 301 do_exit(SIGKILL); 303 - force_sig(SIGKILL, current); 302 + force_sig(SIGKILL); 304 303 } 305 304 306 305 extern int do_page_fault(unsigned long entry, unsigned long addr, ··· 327 326 show_regs(regs); 328 327 if (!user_mode(regs)) 329 328 do_exit(SIGILL); 330 - force_sig(SIGILL, current); 329 + force_sig(SIGILL); 331 330 } 332 331 333 332 #ifdef CONFIG_ALIGNMENT_TRAP
+2 -2
arch/nds32/mm/fault.c
··· 271 271 tsk->thread.address = addr; 272 272 tsk->thread.error_code = error_code; 273 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); 275 275 return; 276 276 } 277 277 ··· 340 340 tsk->thread.address = addr; 341 341 tsk->thread.error_code = error_code; 342 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); 344 344 345 345 return; 346 346
+2 -2
arch/nios2/kernel/signal.c
··· 120 120 return rval; 121 121 122 122 badframe: 123 - force_sig(SIGSEGV, current); 123 + force_sig(SIGSEGV); 124 124 return 0; 125 125 } 126 126 ··· 211 211 return 0; 212 212 213 213 give_sigsegv: 214 - force_sigsegv(ksig->sig, current); 214 + force_sigsegv(ksig->sig); 215 215 return -EFAULT; 216 216 } 217 217
+1 -1
arch/nios2/kernel/traps.c
··· 26 26 27 27 static void _send_sig(int signo, int code, unsigned long addr) 28 28 { 29 - force_sig_fault(signo, code, (void __user *) addr, current); 29 + force_sig_fault(signo, code, (void __user *) addr); 30 30 } 31 31 32 32 void die(const char *str, struct pt_regs *regs, long err)
+1 -1
arch/openrisc/kernel/signal.c
··· 95 95 return regs->gpr[11]; 96 96 97 97 badframe: 98 - force_sig(SIGSEGV, current); 98 + force_sig(SIGSEGV); 99 99 return 0; 100 100 } 101 101
+6 -6
arch/openrisc/kernel/traps.c
··· 244 244 245 245 asmlinkage void do_trap(struct pt_regs *regs, unsigned long address) 246 246 { 247 - force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)address, current); 247 + force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)address); 248 248 249 249 regs->pc += 4; 250 250 } ··· 253 253 { 254 254 if (user_mode(regs)) { 255 255 /* Send a SIGBUS */ 256 - force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)address, current); 256 + force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)address); 257 257 } else { 258 258 printk("KERNEL: Unaligned Access 0x%.8lx\n", address); 259 259 show_registers(regs); ··· 266 266 { 267 267 if (user_mode(regs)) { 268 268 /* Send a SIGBUS */ 269 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current); 269 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 270 270 } else { /* Kernel mode */ 271 271 printk("KERNEL: Bus error (SIGBUS) 0x%.8lx\n", address); 272 272 show_registers(regs); ··· 371 371 372 372 if (get_user(value, lwa_addr)) { 373 373 if (user_mode(regs)) { 374 - force_sig(SIGSEGV, current); 374 + force_sig(SIGSEGV); 375 375 return; 376 376 } 377 377 ··· 418 418 419 419 if (put_user(regs->gpr[rb], vaddr)) { 420 420 if (user_mode(regs)) { 421 - force_sig(SIGSEGV, current); 421 + force_sig(SIGSEGV); 422 422 return; 423 423 } 424 424 ··· 461 461 462 462 if (user_mode(regs)) { 463 463 /* Send a SIGILL */ 464 - force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)address, current); 464 + force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)address); 465 465 } else { /* Kernel mode */ 466 466 printk("KERNEL: Illegal instruction (SIGILL) 0x%.8lx\n", 467 467 address);
+2 -2
arch/openrisc/mm/fault.c
··· 209 209 /* User mode accesses just cause a SIGSEGV */ 210 210 211 211 if (user_mode(regs)) { 212 - force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); 212 + force_sig_fault(SIGSEGV, si_code, (void __user *)address); 213 213 return; 214 214 } 215 215 ··· 274 274 * Send a sigbus, regardless of whether we were in kernel 275 275 * or user mode. 276 276 */ 277 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); 277 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 278 278 279 279 /* Kernel mode? Handle exceptions or die */ 280 280 if (!user_mode(regs))
+3 -3
arch/parisc/kernel/ptrace.c
··· 88 88 ptrace_disable(task); 89 89 /* Don't wake up the task, but let the 90 90 parent know something happened. */ 91 - force_sig_fault(SIGTRAP, TRAP_TRACE, 92 - (void __user *) (task_regs(task)->iaoq[0] & ~3), 93 - task); 91 + force_sig_fault_to_task(SIGTRAP, TRAP_TRACE, 92 + (void __user *) (task_regs(task)->iaoq[0] & ~3), 93 + task); 94 94 /* notify_parent(task, SIGCHLD); */ 95 95 return; 96 96 }
+1 -1
arch/parisc/kernel/signal.c
··· 164 164 165 165 give_sigsegv: 166 166 DBG(1,"sys_rt_sigreturn: Sending SIGSEGV\n"); 167 - force_sig(SIGSEGV, current); 167 + force_sig(SIGSEGV); 168 168 return; 169 169 } 170 170
+7 -7
arch/parisc/kernel/traps.c
··· 275 275 static void handle_gdb_break(struct pt_regs *regs, int wot) 276 276 { 277 277 force_sig_fault(SIGTRAP, wot, 278 - (void __user *) (regs->iaoq[0] & ~3), current); 278 + (void __user *) (regs->iaoq[0] & ~3)); 279 279 } 280 280 281 281 static void handle_break(struct pt_regs *regs) ··· 609 609 si_code = ILL_PRVREG; 610 610 give_sigill: 611 611 force_sig_fault(SIGILL, si_code, 612 - (void __user *) regs->iaoq[0], current); 612 + (void __user *) regs->iaoq[0]); 613 613 return; 614 614 615 615 case 12: 616 616 /* Overflow Trap, let the userland signal handler do the cleanup */ 617 617 force_sig_fault(SIGFPE, FPE_INTOVF, 618 - (void __user *) regs->iaoq[0], current); 618 + (void __user *) regs->iaoq[0]); 619 619 return; 620 620 621 621 case 13: ··· 627 627 * to by si_addr. 628 628 */ 629 629 force_sig_fault(SIGFPE, FPE_CONDTRAP, 630 - (void __user *) regs->iaoq[0], current); 630 + (void __user *) regs->iaoq[0]); 631 631 return; 632 632 } 633 633 /* The kernel doesn't want to handle condition codes */ ··· 739 739 force_sig_fault(SIGSEGV, SEGV_MAPERR, 740 740 (code == 7)? 741 741 ((void __user *) regs->iaoq[0]) : 742 - ((void __user *) regs->ior), current); 742 + ((void __user *) regs->ior)); 743 743 return; 744 744 745 745 case 28: ··· 754 754 task_pid_nr(current), current->comm); 755 755 /* SIGBUS, for lack of a better one. */ 756 756 force_sig_fault(SIGBUS, BUS_OBJERR, 757 - (void __user *)regs->ior, current); 757 + (void __user *)regs->ior); 758 758 return; 759 759 } 760 760 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); ··· 770 770 code, fault_space, 771 771 task_pid_nr(current), current->comm); 772 772 force_sig_fault(SIGSEGV, SEGV_MAPERR, 773 - (void __user *)regs->ior, current); 773 + (void __user *)regs->ior); 774 774 return; 775 775 } 776 776 }
+2 -2
arch/parisc/kernel/unaligned.c
··· 676 676 if (ret == ERR_PAGEFAULT) 677 677 { 678 678 force_sig_fault(SIGSEGV, SEGV_MAPERR, 679 - (void __user *)regs->ior, current); 679 + (void __user *)regs->ior); 680 680 } 681 681 else 682 682 { 683 683 force_sigbus: 684 684 /* couldn't handle it ... */ 685 685 force_sig_fault(SIGBUS, BUS_ADRALN, 686 - (void __user *)regs->ior, current); 686 + (void __user *)regs->ior); 687 687 } 688 688 689 689 return;
+1 -1
arch/parisc/math-emu/driver.c
··· 104 104 memcpy(regs->fr, frcopy, sizeof regs->fr); 105 105 if (signalcode != 0) { 106 106 force_sig_fault(signalcode >> 24, signalcode & 0xffffff, 107 - (void __user *) regs->iaoq[0], current); 107 + (void __user *) regs->iaoq[0]); 108 108 return -1; 109 109 } 110 110
+2 -2
arch/parisc/mm/fault.c
··· 403 403 lsb = PAGE_SHIFT; 404 404 405 405 force_sig_mceerr(BUS_MCEERR_AR, (void __user *) address, 406 - lsb, current); 406 + lsb); 407 407 return; 408 408 } 409 409 #endif 410 410 show_signal_msg(regs, code, address, tsk, vma); 411 411 412 - force_sig_fault(signo, si_code, (void __user *) address, current); 412 + force_sig_fault(signo, si_code, (void __user *) address); 413 413 return; 414 414 } 415 415
+1 -1
arch/powerpc/kernel/process.c
··· 639 639 hw_breakpoint_disable(); 640 640 641 641 /* Deliver the signal to userspace */ 642 - force_sig_fault(SIGTRAP, TRAP_HWBKPT, (void __user *)address, current); 642 + force_sig_fault(SIGTRAP, TRAP_HWBKPT, (void __user *)address); 643 643 } 644 644 #endif /* CONFIG_PPC_ADV_DEBUG_REGS */ 645 645
+3 -3
arch/powerpc/kernel/signal_32.c
··· 1245 1245 current->comm, current->pid, 1246 1246 rt_sf, regs->nip, regs->link); 1247 1247 1248 - force_sig(SIGSEGV, current); 1248 + force_sig(SIGSEGV); 1249 1249 return 0; 1250 1250 } 1251 1251 ··· 1334 1334 current->comm, current->pid, 1335 1335 ctx, regs->nip, regs->link); 1336 1336 1337 - force_sig(SIGSEGV, current); 1337 + force_sig(SIGSEGV); 1338 1338 goto out; 1339 1339 } 1340 1340 ··· 1512 1512 current->comm, current->pid, 1513 1513 addr, regs->nip, regs->link); 1514 1514 1515 - force_sig(SIGSEGV, current); 1515 + force_sig(SIGSEGV); 1516 1516 return 0; 1517 1517 }
+1 -1
arch/powerpc/kernel/signal_64.c
··· 808 808 current->comm, current->pid, "rt_sigreturn", 809 809 (long)uc, regs->nip, regs->link); 810 810 811 - force_sig(SIGSEGV, current); 811 + force_sig(SIGSEGV); 812 812 return 0; 813 813 } 814 814
+2 -2
arch/powerpc/kernel/traps.c
··· 297 297 298 298 void user_single_step_report(struct pt_regs *regs) 299 299 { 300 - force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)regs->nip, current); 300 + force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)regs->nip); 301 301 } 302 302 303 303 static void show_signal_msg(int signr, struct pt_regs *regs, int code, ··· 363 363 if (!exception_common(signr, regs, code, addr)) 364 364 return; 365 365 366 - force_sig_fault(signr, code, (void __user *)addr, current); 366 + force_sig_fault(signr, code, (void __user *)addr); 367 367 } 368 368 369 369 /*
+2 -3
arch/powerpc/mm/fault.c
··· 178 178 if (fault & VM_FAULT_HWPOISON) 179 179 lsb = PAGE_SHIFT; 180 180 181 - force_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, lsb, 182 - current); 181 + force_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, lsb); 183 182 return 0; 184 183 } 185 184 186 185 #endif 187 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current); 186 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 188 187 return 0; 189 188 } 190 189
+4 -5
arch/powerpc/platforms/cell/spufs/fault.c
··· 31 31 32 32 switch (type) { 33 33 case SPE_EVENT_INVALID_DMA: 34 - force_sig_fault(SIGBUS, BUS_OBJERR, NULL, current); 34 + force_sig_fault(SIGBUS, BUS_OBJERR, NULL); 35 35 break; 36 36 case SPE_EVENT_SPE_DATA_STORAGE: 37 37 ctx->ops->restart_dma(ctx); 38 - force_sig_fault(SIGSEGV, SEGV_ACCERR, (void __user *)ea, 39 - current); 38 + force_sig_fault(SIGSEGV, SEGV_ACCERR, (void __user *)ea); 40 39 break; 41 40 case SPE_EVENT_DMA_ALIGNMENT: 42 41 /* DAR isn't set for an alignment fault :( */ 43 - force_sig_fault(SIGBUS, BUS_ADRALN, NULL, current); 42 + force_sig_fault(SIGBUS, BUS_ADRALN, NULL); 44 43 break; 45 44 case SPE_EVENT_SPE_ERROR: 46 45 force_sig_fault( 47 46 SIGILL, ILL_ILLOPC, 48 47 (void __user *)(unsigned long) 49 - ctx->ops->npc_read(ctx) - 4, current); 48 + ctx->ops->npc_read(ctx) - 4); 50 49 break; 51 50 } 52 51 }
+1 -1
arch/powerpc/platforms/cell/spufs/run.c
··· 443 443 444 444 else if (unlikely((status & SPU_STATUS_STOPPED_BY_STOP) 445 445 && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff)) { 446 - force_sig(SIGTRAP, current); 446 + force_sig(SIGTRAP); 447 447 ret = -ERESTARTSYS; 448 448 } 449 449
+1 -1
arch/riscv/include/asm/bug.h
··· 86 86 87 87 extern void die(struct pt_regs *regs, const char *str); 88 88 extern void do_trap(struct pt_regs *regs, int signo, int code, 89 - unsigned long addr, struct task_struct *tsk); 89 + unsigned long addr); 90 90 91 91 #endif /* !__ASSEMBLY__ */ 92 92
+1 -1
arch/riscv/kernel/signal.c
··· 126 126 task->comm, task_pid_nr(task), __func__, 127 127 frame, (void *)regs->sepc, (void *)regs->sp); 128 128 } 129 - force_sig(SIGSEGV, task); 129 + force_sig(SIGSEGV); 130 130 return 0; 131 131 } 132 132
+6 -5
arch/riscv/kernel/traps.c
··· 55 55 do_exit(SIGSEGV); 56 56 } 57 57 58 - void do_trap(struct pt_regs *regs, int signo, int code, 59 - unsigned long addr, struct task_struct *tsk) 58 + void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr) 60 59 { 60 + struct task_struct *tsk = current; 61 + 61 62 if (show_unhandled_signals && unhandled_signal(tsk, signo) 62 63 && printk_ratelimit()) { 63 64 pr_info("%s[%d]: unhandled signal %d code 0x%x at 0x" REG_FMT, ··· 68 67 show_regs(regs); 69 68 } 70 69 71 - force_sig_fault(signo, code, (void __user *)addr, tsk); 70 + force_sig_fault(signo, code, (void __user *)addr); 72 71 } 73 72 74 73 static void do_trap_error(struct pt_regs *regs, int signo, int code, 75 74 unsigned long addr, const char *str) 76 75 { 77 76 if (user_mode(regs)) { 78 - do_trap(regs, signo, code, addr, current); 77 + do_trap(regs, signo, code, addr); 79 78 } else { 80 79 if (!fixup_exception(regs)) 81 80 die(regs, str); ··· 141 140 } 142 141 #endif /* CONFIG_GENERIC_BUG */ 143 142 144 - force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)(regs->sepc), current); 143 + force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)(regs->sepc)); 145 144 } 146 145 147 146 #ifdef CONFIG_GENERIC_BUG
+3 -3
arch/riscv/mm/fault.c
··· 169 169 up_read(&mm->mmap_sem); 170 170 /* User mode accesses just cause a SIGSEGV */ 171 171 if (user_mode(regs)) { 172 - do_trap(regs, SIGSEGV, code, addr, tsk); 172 + do_trap(regs, SIGSEGV, code, addr); 173 173 return; 174 174 } 175 175 ··· 205 205 /* Kernel mode? Handle exceptions or die */ 206 206 if (!user_mode(regs)) 207 207 goto no_context; 208 - do_trap(regs, SIGBUS, BUS_ADRERR, addr, tsk); 208 + do_trap(regs, SIGBUS, BUS_ADRERR, addr); 209 209 return; 210 210 211 211 vmalloc_fault: ··· 219 219 220 220 /* User mode accesses just cause a SIGSEGV */ 221 221 if (user_mode(regs)) 222 - return do_trap(regs, SIGSEGV, code, addr, tsk); 222 + return do_trap(regs, SIGSEGV, code, addr); 223 223 224 224 /* 225 225 * Synchronize this task's top level page-table
+2 -2
arch/s390/kernel/compat_signal.c
··· 194 194 load_sigregs(); 195 195 return regs->gprs[2]; 196 196 badframe: 197 - force_sig(SIGSEGV, current); 197 + force_sig(SIGSEGV); 198 198 return 0; 199 199 } 200 200 ··· 217 217 load_sigregs(); 218 218 return regs->gprs[2]; 219 219 badframe: 220 - force_sig(SIGSEGV, current); 220 + force_sig(SIGSEGV); 221 221 return 0; 222 222 } 223 223
+2 -2
arch/s390/kernel/signal.c
··· 232 232 load_sigregs(); 233 233 return regs->gprs[2]; 234 234 badframe: 235 - force_sig(SIGSEGV, current); 235 + force_sig(SIGSEGV); 236 236 return 0; 237 237 } 238 238 ··· 256 256 load_sigregs(); 257 257 return regs->gprs[2]; 258 258 badframe: 259 - force_sig(SIGSEGV, current); 259 + force_sig(SIGSEGV); 260 260 return 0; 261 261 } 262 262
+3 -3
arch/s390/kernel/traps.c
··· 45 45 void do_report_trap(struct pt_regs *regs, int si_signo, int si_code, char *str) 46 46 { 47 47 if (user_mode(regs)) { 48 - force_sig_fault(si_signo, si_code, get_trap_ip(regs), current); 48 + force_sig_fault(si_signo, si_code, get_trap_ip(regs)); 49 49 report_user_fault(regs, si_signo, 0); 50 50 } else { 51 51 const struct exception_table_entry *fixup; ··· 79 79 if (!current->ptrace) 80 80 return; 81 81 force_sig_fault(SIGTRAP, TRAP_HWBKPT, 82 - (void __force __user *) current->thread.per_event.address, current); 82 + (void __force __user *) current->thread.per_event.address); 83 83 } 84 84 NOKPROBE_SYMBOL(do_per_trap); 85 85 ··· 165 165 return; 166 166 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { 167 167 if (current->ptrace) 168 - force_sig_fault(SIGTRAP, TRAP_BRKPT, location, current); 168 + force_sig_fault(SIGTRAP, TRAP_BRKPT, location); 169 169 else 170 170 signal = SIGILL; 171 171 #ifdef CONFIG_UPROBES
+2 -4
arch/s390/mm/fault.c
··· 248 248 { 249 249 report_user_fault(regs, SIGSEGV, 1); 250 250 force_sig_fault(SIGSEGV, si_code, 251 - (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK), 252 - current); 251 + (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK)); 253 252 } 254 253 255 254 const struct exception_table_entry *s390_search_extables(unsigned long addr) ··· 309 310 * or user mode. 310 311 */ 311 312 force_sig_fault(SIGBUS, BUS_ADRERR, 312 - (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK), 313 - current); 313 + (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK)); 314 314 } 315 315 316 316 static noinline int signal_return(struct pt_regs *regs)
+1 -1
arch/sh/kernel/cpu/sh2a/fpu.c
··· 568 568 return; 569 569 } 570 570 571 - force_sig(SIGFPE, tsk); 571 + force_sig(SIGFPE); 572 572 }
+1 -1
arch/sh/kernel/cpu/sh4/fpu.c
··· 421 421 } 422 422 } 423 423 424 - force_sig(SIGFPE, tsk); 424 + force_sig(SIGFPE); 425 425 }
+1 -3
arch/sh/kernel/cpu/sh5/fpu.c
··· 100 100 101 101 asmlinkage void do_fpu_error(unsigned long ex, struct pt_regs *regs) 102 102 { 103 - struct task_struct *tsk = current; 104 - 105 103 regs->pc += 4; 106 104 107 - force_sig(SIGFPE, tsk); 105 + force_sig(SIGFPE); 108 106 }
+1 -1
arch/sh/kernel/hw_breakpoint.c
··· 338 338 /* Deliver the signal to userspace */ 339 339 if (!arch_check_bp_in_kernelspace(&bp->hw.info)) { 340 340 force_sig_fault(SIGTRAP, TRAP_HWBKPT, 341 - (void __user *)NULL, current); 341 + (void __user *)NULL); 342 342 } 343 343 344 344 rcu_read_unlock();
+2 -2
arch/sh/kernel/ptrace_64.c
··· 550 550 continually stepping. */ 551 551 local_irq_enable(); 552 552 regs->sr &= ~SR_SSTEP; 553 - force_sig(SIGTRAP, current); 553 + force_sig(SIGTRAP); 554 554 } 555 555 556 556 /* Called with interrupts disabled */ ··· 561 561 /* We need to forward step the PC, to counteract the backstep done 562 562 in signal.c. */ 563 563 local_irq_enable(); 564 - force_sig(SIGTRAP, current); 564 + force_sig(SIGTRAP); 565 565 regs->pc += 4; 566 566 } 567 567
+2 -2
arch/sh/kernel/signal_32.c
··· 176 176 return r0; 177 177 178 178 badframe: 179 - force_sig(SIGSEGV, current); 179 + force_sig(SIGSEGV); 180 180 return 0; 181 181 } 182 182 ··· 207 207 return r0; 208 208 209 209 badframe: 210 - force_sig(SIGSEGV, current); 210 + force_sig(SIGSEGV); 211 211 return 0; 212 212 } 213 213
+2 -2
arch/sh/kernel/signal_64.c
··· 277 277 return (int) ret; 278 278 279 279 badframe: 280 - force_sig(SIGSEGV, current); 280 + force_sig(SIGSEGV); 281 281 return 0; 282 282 } 283 283 ··· 311 311 return (int) ret; 312 312 313 313 badframe: 314 - force_sig(SIGSEGV, current); 314 + force_sig(SIGSEGV); 315 315 return 0; 316 316 } 317 317
+2 -2
arch/sh/kernel/traps.c
··· 141 141 SIGTRAP) == NOTIFY_STOP) 142 142 return; 143 143 144 - force_sig(SIGTRAP, current); 144 + force_sig(SIGTRAP); 145 145 } 146 146 147 147 /* ··· 167 167 } 168 168 #endif 169 169 170 - force_sig(SIGTRAP, current); 170 + force_sig(SIGTRAP); 171 171 } 172 172 173 173 BUILD_TRAP_HANDLER(nmi)
+5 -7
arch/sh/kernel/traps_32.c
··· 533 533 "access (PC %lx PR %lx)\n", current->comm, regs->pc, 534 534 regs->pr); 535 535 536 - force_sig_fault(SIGBUS, si_code, (void __user *)address, current); 536 + force_sig_fault(SIGBUS, si_code, (void __user *)address); 537 537 } else { 538 538 inc_unaligned_kernel_access(); 539 539 ··· 603 603 /* Let gcc know unhandled cases don't make it past here */ 604 604 return; 605 605 } 606 - force_sig_fault(SIGFPE, code, NULL, current); 606 + force_sig_fault(SIGFPE, code, NULL); 607 607 } 608 608 #endif 609 609 ··· 611 611 { 612 612 struct pt_regs *regs = current_pt_regs(); 613 613 unsigned long error_code; 614 - struct task_struct *tsk = current; 615 614 616 615 #ifdef CONFIG_SH_FPU_EMU 617 616 unsigned short inst = 0; ··· 632 633 /* Enable DSP mode, and restart instruction. */ 633 634 regs->sr |= SR_DSP; 634 635 /* Save DSP mode */ 635 - tsk->thread.dsp_status.status |= SR_DSP; 636 + current->thread.dsp_status.status |= SR_DSP; 636 637 return; 637 638 } 638 639 #endif ··· 640 641 error_code = lookup_exception_vector(); 641 642 642 643 local_irq_enable(); 643 - force_sig(SIGILL, tsk); 644 + force_sig(SIGILL); 644 645 die_if_no_fixup("reserved instruction", regs, error_code); 645 646 } 646 647 ··· 696 697 { 697 698 struct pt_regs *regs = current_pt_regs(); 698 699 unsigned long inst; 699 - struct task_struct *tsk = current; 700 700 701 701 if (kprobe_handle_illslot(regs->pc) == 0) 702 702 return; ··· 714 716 inst = lookup_exception_vector(); 715 717 716 718 local_irq_enable(); 717 - force_sig(SIGILL, tsk); 719 + force_sig(SIGILL); 718 720 die_if_no_fixup("illegal slot instruction", regs, inst); 719 721 } 720 722
+1 -1
arch/sh/kernel/traps_64.c
··· 599 599 struct pt_regs *regs) 600 600 { 601 601 if (user_mode(regs)) 602 - force_sig(signr, current); 602 + force_sig(signr); 603 603 604 604 die_if_no_fixup(str, regs, error); 605 605 }
+1 -1
arch/sh/math-emu/math.c
··· 560 560 task_thread_info(tsk)->status |= TS_USEDFPU; 561 561 } else { 562 562 force_sig_fault(SIGFPE, FPE_FLTINV, 563 - (void __user *)regs->pc, tsk); 563 + (void __user *)regs->pc); 564 564 } 565 565 566 566 regs->pc = nextpc;
+4 -7
arch/sh/mm/fault.c
··· 39 39 } 40 40 41 41 static void 42 - force_sig_info_fault(int si_signo, int si_code, unsigned long address, 43 - struct task_struct *tsk) 42 + force_sig_info_fault(int si_signo, int si_code, unsigned long address) 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 /* ··· 243 244 __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, 244 245 unsigned long address, int si_code) 245 246 { 246 - struct task_struct *tsk = current; 247 - 248 247 /* User mode accesses just cause a SIGSEGV */ 249 248 if (user_mode(regs)) { 250 249 /* ··· 250 253 */ 251 254 local_irq_enable(); 252 255 253 - force_sig_info_fault(SIGSEGV, si_code, address, tsk); 256 + force_sig_info_fault(SIGSEGV, si_code, address); 254 257 255 258 return; 256 259 } ··· 305 308 if (!user_mode(regs)) 306 309 no_context(regs, error_code, address); 307 310 308 - force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk); 311 + force_sig_info_fault(SIGBUS, BUS_ADRERR, address); 309 312 } 310 313 311 314 static noinline int
+2 -2
arch/sparc/kernel/process_64.c
··· 519 519 520 520 static void stack_unaligned(unsigned long sp) 521 521 { 522 - force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) sp, 0, current); 522 + force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) sp, 0); 523 523 } 524 524 525 525 static const char uwfault32[] = KERN_INFO \ ··· 570 570 571 571 barf: 572 572 set_thread_wsaved(window + 1); 573 - force_sig(SIGSEGV, current); 573 + force_sig(SIGSEGV); 574 574 } 575 575 576 576 asmlinkage long sparc_do_fork(unsigned long clone_flags,
+4 -4
arch/sparc/kernel/signal32.c
··· 170 170 return; 171 171 172 172 segv: 173 - force_sig(SIGSEGV, current); 173 + force_sig(SIGSEGV); 174 174 } 175 175 176 176 asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) ··· 256 256 set_current_blocked(&set); 257 257 return; 258 258 segv: 259 - force_sig(SIGSEGV, current); 259 + force_sig(SIGSEGV); 260 260 } 261 261 262 262 static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize) ··· 375 375 pr_info("%s[%d] bad frame in setup_frame32: %08lx TPC %08lx O7 %08lx\n", 376 376 current->comm, current->pid, (unsigned long)sf, 377 377 regs->tpc, regs->u_regs[UREG_I7]); 378 - force_sigsegv(ksig->sig, current); 378 + force_sigsegv(ksig->sig); 379 379 return -EINVAL; 380 380 } 381 381 ··· 509 509 pr_info("%s[%d] bad frame in setup_rt_frame32: %08lx TPC %08lx O7 %08lx\n", 510 510 current->comm, current->pid, (unsigned long)sf, 511 511 regs->tpc, regs->u_regs[UREG_I7]); 512 - force_sigsegv(ksig->sig, current); 512 + force_sigsegv(ksig->sig); 513 513 return -EINVAL; 514 514 } 515 515
+2 -2
arch/sparc/kernel/signal_32.c
··· 137 137 return; 138 138 139 139 segv_and_exit: 140 - force_sig(SIGSEGV, current); 140 + force_sig(SIGSEGV); 141 141 } 142 142 143 143 asmlinkage void do_rt_sigreturn(struct pt_regs *regs) ··· 196 196 set_current_blocked(&set); 197 197 return; 198 198 segv: 199 - force_sig(SIGSEGV, current); 199 + force_sig(SIGSEGV); 200 200 } 201 201 202 202 static inline void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize)
+4 -4
arch/sparc/kernel/signal_64.c
··· 134 134 exception_exit(prev_state); 135 135 return; 136 136 do_sigsegv: 137 - force_sig(SIGSEGV, current); 137 + force_sig(SIGSEGV); 138 138 goto out; 139 139 } 140 140 ··· 228 228 exception_exit(prev_state); 229 229 return; 230 230 do_sigsegv: 231 - force_sig(SIGSEGV, current); 231 + force_sig(SIGSEGV); 232 232 goto out; 233 233 } 234 234 ··· 320 320 set_current_blocked(&set); 321 321 return; 322 322 segv: 323 - force_sig(SIGSEGV, current); 323 + force_sig(SIGSEGV); 324 324 } 325 325 326 326 static inline void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, unsigned long framesize) ··· 374 374 pr_info("%s[%d] bad frame in setup_rt_frame: %016lx TPC %016lx O7 %016lx\n", 375 375 current->comm, current->pid, (unsigned long)sf, 376 376 regs->tpc, regs->u_regs[UREG_I7]); 377 - force_sigsegv(ksig->sig, current); 377 + force_sigsegv(ksig->sig); 378 378 return -EINVAL; 379 379 } 380 380
+1 -1
arch/sparc/kernel/sys_sparc_32.c
··· 151 151 #ifdef DEBUG_SPARC_BREAKPOINT 152 152 printk ("TRAP: Entering kernel PC=%x, nPC=%x\n", regs->pc, regs->npc); 153 153 #endif 154 - force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc, 0, current); 154 + force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc, 0); 155 155 156 156 #ifdef DEBUG_SPARC_BREAKPOINT 157 157 printk ("TRAP: Returning to space: PC=%x nPC=%x\n", regs->pc, regs->npc);
+1 -1
arch/sparc/kernel/sys_sparc_64.c
··· 511 511 #ifdef DEBUG_SPARC_BREAKPOINT 512 512 printk ("TRAP: Entering kernel PC=%lx, nPC=%lx\n", regs->tpc, regs->tnpc); 513 513 #endif 514 - force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->tpc, 0, current); 514 + force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->tpc, 0); 515 515 #ifdef DEBUG_SPARC_BREAKPOINT 516 516 printk ("TRAP: Returning to space: PC=%lx nPC=%lx\n", regs->tpc, regs->tnpc); 517 517 #endif
+2 -2
arch/sparc/kernel/traps_32.c
··· 103 103 die_if_kernel("Kernel bad trap", regs); 104 104 105 105 force_sig_fault(SIGILL, ILL_ILLTRP, 106 - (void __user *)regs->pc, type - 0x80, current); 106 + (void __user *)regs->pc, type - 0x80); 107 107 } 108 108 109 109 void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc, ··· 327 327 printk("Register Access Exception at PC %08lx NPC %08lx PSR %08lx\n", 328 328 pc, npc, psr); 329 329 #endif 330 - force_sig_fault(SIGBUS, BUS_OBJERR, (void __user *)pc, 0, current); 330 + force_sig_fault(SIGBUS, BUS_OBJERR, (void __user *)pc, 0); 331 331 } 332 332 333 333 void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, unsigned long npc,
+19 -22
arch/sparc/kernel/traps_64.c
··· 108 108 regs->tnpc &= 0xffffffff; 109 109 } 110 110 force_sig_fault(SIGILL, ILL_ILLTRP, 111 - (void __user *)regs->tpc, lvl, current); 111 + (void __user *)regs->tpc, lvl); 112 112 } 113 113 114 114 void bad_trap_tl1(struct pt_regs *regs, long lvl) ··· 202 202 regs->tnpc &= 0xffffffff; 203 203 } 204 204 force_sig_fault(SIGSEGV, SEGV_MAPERR, 205 - (void __user *)regs->tpc, 0, current); 205 + (void __user *)regs->tpc, 0); 206 206 out: 207 207 exception_exit(prev_state); 208 208 } ··· 237 237 regs->tpc &= 0xffffffff; 238 238 regs->tnpc &= 0xffffffff; 239 239 } 240 - force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *) addr, 0, current); 240 + force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *) addr, 0); 241 241 } 242 242 243 243 void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx) ··· 322 322 if (is_no_fault_exception(regs)) 323 323 return; 324 324 325 - force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)sfar, 0, current); 325 + force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)sfar, 0); 326 326 out: 327 327 exception_exit(prev_state); 328 328 } ··· 386 386 */ 387 387 switch (type) { 388 388 case HV_FAULT_TYPE_INV_ASI: 389 - force_sig_fault(SIGILL, ILL_ILLADR, (void __user *)addr, 0, 390 - current); 389 + force_sig_fault(SIGILL, ILL_ILLADR, (void __user *)addr, 0); 391 390 break; 392 391 case HV_FAULT_TYPE_MCD_DIS: 393 - force_sig_fault(SIGSEGV, SEGV_ACCADI, (void __user *)addr, 0, 394 - current); 392 + force_sig_fault(SIGSEGV, SEGV_ACCADI, (void __user *)addr, 0); 395 393 break; 396 394 default: 397 - force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)addr, 0, 398 - current); 395 + force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)addr, 0); 399 396 break; 400 397 } 401 398 } ··· 569 572 regs->tpc &= 0xffffffff; 570 573 regs->tnpc &= 0xffffffff; 571 574 } 572 - force_sig_fault(SIGBUS, BUS_OBJERR, (void *)0, 0, current); 575 + force_sig_fault(SIGBUS, BUS_OBJERR, (void *)0, 0); 573 576 } 574 577 575 578 void spitfire_access_error(struct pt_regs *regs, unsigned long status_encoded, unsigned long afar) ··· 2071 2074 * code 2072 2075 */ 2073 2076 force_sig_fault(SIGSEGV, SEGV_ADIDERR, (void __user *)ent.err_raddr, 2074 - 0, current); 2077 + 0); 2075 2078 } 2076 2079 2077 2080 /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate. ··· 2179 2182 addr += PAGE_SIZE; 2180 2183 } 2181 2184 } 2182 - force_sig(SIGKILL, current); 2185 + force_sig(SIGKILL); 2183 2186 2184 2187 return true; 2185 2188 } 2186 2189 if (attrs & SUN4V_ERR_ATTRS_PIO) { 2187 2190 force_sig_fault(SIGBUS, BUS_ADRERR, 2188 - (void __user *)sun4v_get_vaddr(regs), 0, current); 2191 + (void __user *)sun4v_get_vaddr(regs), 0); 2189 2192 return true; 2190 2193 } 2191 2194 ··· 2342 2345 code = FPE_FLTRES; 2343 2346 } 2344 2347 force_sig_fault(SIGFPE, code, 2345 - (void __user *)regs->tpc, 0, current); 2348 + (void __user *)regs->tpc, 0); 2346 2349 } 2347 2350 } 2348 2351 ··· 2397 2400 regs->tnpc &= 0xffffffff; 2398 2401 } 2399 2402 force_sig_fault(SIGEMT, EMT_TAGOVF, 2400 - (void __user *)regs->tpc, 0, current); 2403 + (void __user *)regs->tpc, 0); 2401 2404 out: 2402 2405 exception_exit(prev_state); 2403 2406 } ··· 2417 2420 regs->tnpc &= 0xffffffff; 2418 2421 } 2419 2422 force_sig_fault(SIGFPE, FPE_INTDIV, 2420 - (void __user *)regs->tpc, 0, current); 2423 + (void __user *)regs->tpc, 0); 2421 2424 out: 2422 2425 exception_exit(prev_state); 2423 2426 } ··· 2613 2616 } 2614 2617 } 2615 2618 } 2616 - force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, 0, current); 2619 + force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, 0); 2617 2620 out: 2618 2621 exception_exit(prev_state); 2619 2622 } ··· 2633 2636 if (is_no_fault_exception(regs)) 2634 2637 return; 2635 2638 2636 - force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)sfar, 0, current); 2639 + force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)sfar, 0); 2637 2640 out: 2638 2641 exception_exit(prev_state); 2639 2642 } ··· 2651 2654 if (is_no_fault_exception(regs)) 2652 2655 return; 2653 2656 2654 - force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) addr, 0, current); 2657 + force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) addr, 0); 2655 2658 } 2656 2659 2657 2660 /* sun4v_mem_corrupt_detect_precise() - Handle precise exception on an ADI ··· 2698 2701 regs->tpc &= 0xffffffff; 2699 2702 regs->tnpc &= 0xffffffff; 2700 2703 } 2701 - force_sig_fault(SIGSEGV, SEGV_ADIPERR, (void __user *)addr, 0, current); 2704 + force_sig_fault(SIGSEGV, SEGV_ADIPERR, (void __user *)addr, 0); 2702 2705 } 2703 2706 2704 2707 void do_privop(struct pt_regs *regs) ··· 2714 2717 regs->tnpc &= 0xffffffff; 2715 2718 } 2716 2719 force_sig_fault(SIGILL, ILL_PRVOPC, 2717 - (void __user *)regs->tpc, 0, current); 2720 + (void __user *)regs->tpc, 0); 2718 2721 out: 2719 2722 exception_exit(prev_state); 2720 2723 }
+2 -2
arch/sparc/mm/fault_32.c
··· 131 131 show_signal_msg(regs, sig, code, 132 132 addr, current); 133 133 134 - force_sig_fault(sig, code, (void __user *) addr, 0, current); 134 + force_sig_fault(sig, code, (void __user *) addr, 0); 135 135 } 136 136 137 137 static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault) ··· 425 425 static void check_stack_aligned(unsigned long sp) 426 426 { 427 427 if (sp & 0x7UL) 428 - force_sig(SIGILL, current); 428 + force_sig(SIGILL); 429 429 } 430 430 431 431 void window_overflow_fault(void)
+1 -1
arch/sparc/mm/fault_64.c
··· 187 187 if (unlikely(show_unhandled_signals)) 188 188 show_signal_msg(regs, sig, code, addr, current); 189 189 190 - force_sig_fault(sig, code, (void __user *) addr, 0, current); 190 + force_sig_fault(sig, code, (void __user *) addr, 0); 191 191 } 192 192 193 193 static unsigned int get_fault_insn(struct pt_regs *regs, unsigned int insn)
+1 -1
arch/um/kernel/exec.c
··· 32 32 if (ret) { 33 33 printk(KERN_ERR "flush_thread - clearing address space failed, " 34 34 "err = %d\n", ret); 35 - force_sig(SIGKILL, current); 35 + force_sig(SIGKILL); 36 36 } 37 37 get_safe_registers(current_pt_regs()->regs.gp, 38 38 current_pt_regs()->regs.fp);
+3 -4
arch/um/kernel/ptrace.c
··· 112 112 return ret; 113 113 } 114 114 115 - static void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, 116 - int error_code) 115 + static void send_sigtrap(struct uml_pt_regs *regs, int error_code) 117 116 { 118 117 /* Send us the fake SIGTRAP */ 119 118 force_sig_fault(SIGTRAP, TRAP_BRKPT, 120 119 /* User-mode eip? */ 121 - UPT_IS_USER(regs) ? (void __user *) UPT_IP(regs) : NULL, tsk); 120 + UPT_IS_USER(regs) ? (void __user *) UPT_IP(regs) : NULL); 122 121 } 123 122 124 123 /* ··· 146 147 147 148 /* Fake a debug trap */ 148 149 if (ptraced & PT_DTRACE) 149 - send_sigtrap(current, &regs->regs, 0); 150 + send_sigtrap(&regs->regs, 0); 150 151 151 152 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 152 153 return;
+1 -1
arch/um/kernel/skas/mmu.c
··· 119 119 return; 120 120 121 121 out: 122 - force_sigsegv(SIGSEGV, current); 122 + force_sigsegv(SIGSEGV); 123 123 } 124 124 125 125 void arch_exit_mmap(struct mm_struct *mm)
+2 -2
arch/um/kernel/tlb.c
··· 329 329 "process: %d\n", task_tgid_vnr(current)); 330 330 /* We are under mmap_sem, release it such that current can terminate */ 331 331 up_write(&current->mm->mmap_sem); 332 - force_sig(SIGKILL, current); 332 + force_sig(SIGKILL); 333 333 do_signal(&current->thread.regs); 334 334 } 335 335 } ··· 487 487 488 488 kill: 489 489 printk(KERN_ERR "Failed to flush page for address 0x%lx\n", address); 490 - force_sig(SIGKILL, current); 490 + force_sig(SIGKILL); 491 491 } 492 492 493 493 pgd_t *pgd_offset_proc(struct mm_struct *mm, unsigned long address)
+6 -10
arch/um/kernel/trap.c
··· 163 163 static void bad_segv(struct faultinfo fi, unsigned long ip) 164 164 { 165 165 current->thread.arch.faultinfo = fi; 166 - force_sig_fault(SIGSEGV, SEGV_ACCERR, (void __user *) FAULT_ADDRESS(fi), 167 - current); 166 + force_sig_fault(SIGSEGV, SEGV_ACCERR, (void __user *) FAULT_ADDRESS(fi)); 168 167 } 169 168 170 169 void fatal_sigsegv(void) 171 170 { 172 - force_sigsegv(SIGSEGV, current); 171 + force_sigsegv(SIGSEGV); 173 172 do_signal(&current->thread.regs); 174 173 /* 175 174 * This is to tell gcc that we're not returning - do_signal ··· 267 268 268 269 if (err == -EACCES) { 269 270 current->thread.arch.faultinfo = fi; 270 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, 271 - current); 271 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 272 272 } else { 273 273 BUG_ON(err != -EFAULT); 274 274 current->thread.arch.faultinfo = fi; 275 - force_sig_fault(SIGSEGV, si_code, (void __user *) address, 276 - current); 275 + force_sig_fault(SIGSEGV, si_code, (void __user *) address); 277 276 } 278 277 279 278 out: ··· 301 304 if ((err == 0) && (siginfo_layout(sig, code) == SIL_FAULT)) { 302 305 struct faultinfo *fi = UPT_FAULTINFO(regs); 303 306 current->thread.arch.faultinfo = *fi; 304 - force_sig_fault(sig, code, (void __user *)FAULT_ADDRESS(*fi), 305 - current); 307 + force_sig_fault(sig, code, (void __user *)FAULT_ADDRESS(*fi)); 306 308 } else { 307 309 printk(KERN_ERR "Attempted to relay unknown signal %d (si_code = %d) with errno %d\n", 308 310 sig, code, err); 309 - force_sig(sig, current); 311 + force_sig(sig); 310 312 } 311 313 } 312 314
+2 -2
arch/unicore32/kernel/signal.c
··· 126 126 return regs->UCreg_00; 127 127 128 128 badframe: 129 - force_sig(SIGSEGV, current); 129 + force_sig(SIGSEGV); 130 130 return 0; 131 131 } 132 132 ··· 383 383 regs->UCreg_pc = KERN_RESTART_CODE; 384 384 } else { 385 385 regs->UCreg_sp += 4; 386 - force_sigsegv(0, current); 386 + force_sigsegv(0); 387 387 } 388 388 } 389 389 if (regs->UCreg_00 == -ERESTARTNOHAND ||
+1 -1
arch/unicore32/kernel/traps.c
··· 245 245 current->thread.error_code = err; 246 246 current->thread.trap_no = trap; 247 247 248 - force_sig_fault(sig, code, addr, current); 248 + force_sig_fault(sig, code, addr); 249 249 } else 250 250 die(str, regs, err); 251 251 }
+7 -6
arch/unicore32/mm/fault.c
··· 113 113 * Something tried to access memory that isn't in our memory map.. 114 114 * User mode accesses just cause a SIGSEGV 115 115 */ 116 - static void __do_user_fault(struct task_struct *tsk, unsigned long addr, 117 - unsigned int fsr, unsigned int sig, int code, 118 - struct pt_regs *regs) 116 + static void __do_user_fault(unsigned long addr, unsigned int fsr, 117 + unsigned int sig, int code, struct pt_regs *regs) 119 118 { 119 + struct task_struct *tsk = current; 120 + 120 121 tsk->thread.address = addr; 121 122 tsk->thread.error_code = fsr; 122 123 tsk->thread.trap_no = 14; 123 - force_sig_fault(sig, code, (void __user *)addr, tsk); 124 + force_sig_fault(sig, code, (void __user *)addr); 124 125 } 125 126 126 127 void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ··· 134 133 * have no context to handle this fault with. 135 134 */ 136 135 if (user_mode(regs)) 137 - __do_user_fault(tsk, addr, fsr, SIGSEGV, SEGV_MAPERR, regs); 136 + __do_user_fault(addr, fsr, SIGSEGV, SEGV_MAPERR, regs); 138 137 else 139 138 __do_kernel_fault(mm, addr, fsr, regs); 140 139 } ··· 308 307 code = fault == VM_FAULT_BADACCESS ? SEGV_ACCERR : SEGV_MAPERR; 309 308 } 310 309 311 - __do_user_fault(tsk, addr, fsr, sig, code, regs); 310 + __do_user_fault(addr, fsr, sig, code, regs); 312 311 return 0; 313 312 314 313 no_context:
+2 -2
arch/x86/entry/vsyscall/vsyscall_64.c
··· 110 110 thread->cr2 = ptr; 111 111 thread->trap_nr = X86_TRAP_PF; 112 112 113 - force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)ptr, current); 113 + force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)ptr); 114 114 return false; 115 115 } else { 116 116 return true; ··· 289 289 return true; 290 290 291 291 sigsegv: 292 - force_sig(SIGSEGV, current); 292 + force_sig(SIGSEGV); 293 293 return true; 294 294 } 295 295
+1 -2
arch/x86/include/asm/ptrace.h
··· 102 102 103 103 extern unsigned long 104 104 convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); 105 - extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, 106 - int error_code, int si_code); 105 + extern void send_sigtrap(struct pt_regs *regs, int error_code, int si_code); 107 106 108 107 109 108 static inline unsigned long regs_return_value(struct pt_regs *regs)
+1 -1
arch/x86/kernel/cpu/mce/core.c
··· 1348 1348 local_irq_enable(); 1349 1349 1350 1350 if (kill_it || do_memory_failure(&m)) 1351 - force_sig(SIGBUS, current); 1351 + force_sig(SIGBUS); 1352 1352 local_irq_disable(); 1353 1353 ist_end_non_atomic(); 1354 1354 } else {
+5 -4
arch/x86/kernel/ptrace.c
··· 1321 1321 #endif 1322 1322 } 1323 1323 1324 - void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, 1325 - int error_code, int si_code) 1324 + void send_sigtrap(struct pt_regs *regs, int error_code, int si_code) 1326 1325 { 1326 + struct task_struct *tsk = current; 1327 + 1327 1328 tsk->thread.trap_nr = X86_TRAP_DB; 1328 1329 tsk->thread.error_code = error_code; 1329 1330 1330 1331 /* Send us the fake SIGTRAP */ 1331 1332 force_sig_fault(SIGTRAP, si_code, 1332 - user_mode(regs) ? (void __user *)regs->ip : NULL, tsk); 1333 + user_mode(regs) ? (void __user *)regs->ip : NULL); 1333 1334 } 1334 1335 1335 1336 void user_single_step_report(struct pt_regs *regs) 1336 1337 { 1337 - send_sigtrap(current, regs, 0, TRAP_BRKPT); 1338 + send_sigtrap(regs, 0, TRAP_BRKPT); 1338 1339 }
+1 -1
arch/x86/kernel/signal.c
··· 857 857 pr_cont("\n"); 858 858 } 859 859 860 - force_sig(SIGSEGV, me); 860 + force_sig(SIGSEGV); 861 861 } 862 862 863 863 #ifdef CONFIG_X86_X32_ABI
+5 -5
arch/x86/kernel/traps.c
··· 254 254 show_signal(tsk, signr, "trap ", str, regs, error_code); 255 255 256 256 if (!sicode) 257 - force_sig(signr, tsk); 257 + force_sig(signr); 258 258 else 259 - force_sig_fault(signr, sicode, addr, tsk); 259 + force_sig_fault(signr, sicode, addr); 260 260 } 261 261 NOKPROBE_SYMBOL(do_trap); 262 262 ··· 566 566 567 567 show_signal(tsk, SIGSEGV, "", desc, regs, error_code); 568 568 569 - force_sig(SIGSEGV, tsk); 569 + force_sig(SIGSEGV); 570 570 } 571 571 NOKPROBE_SYMBOL(do_general_protection); 572 572 ··· 805 805 } 806 806 si_code = get_si_code(tsk->thread.debugreg6); 807 807 if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) 808 - send_sigtrap(tsk, regs, error_code, si_code); 808 + send_sigtrap(regs, error_code, si_code); 809 809 cond_local_irq_disable(regs); 810 810 debug_stack_usage_dec(); 811 811 ··· 856 856 return; 857 857 858 858 force_sig_fault(SIGFPE, si_code, 859 - (void __user *)uprobe_get_trap_addr(regs), task); 859 + (void __user *)uprobe_get_trap_addr(regs)); 860 860 } 861 861 862 862 dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code)
+1 -1
arch/x86/kernel/umip.c
··· 277 277 tsk->thread.error_code = X86_PF_USER | X86_PF_WRITE; 278 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); 281 281 282 282 if (!(show_unhandled_signals && unhandled_signal(tsk, SIGSEGV))) 283 283 return;
+1 -1
arch/x86/kernel/uprobes.c
··· 1074 1074 pr_err("return address clobbered: pid=%d, %%sp=%#lx, %%ip=%#lx\n", 1075 1075 current->pid, regs->sp, regs->ip); 1076 1076 1077 - force_sig(SIGSEGV, current); 1077 + force_sig(SIGSEGV); 1078 1078 } 1079 1079 1080 1080 return -1;
+1 -1
arch/x86/kernel/vm86_32.c
··· 583 583 return 1; /* we let this handle by the calling routine */ 584 584 current->thread.trap_nr = trapno; 585 585 current->thread.error_code = error_code; 586 - force_sig(SIGTRAP, current); 586 + force_sig(SIGTRAP); 587 587 return 0; 588 588 } 589 589
+5 -7
arch/x86/mm/fault.c
··· 760 760 set_signal_archinfo(address, error_code); 761 761 762 762 /* XXX: hwpoison faults will set the wrong code. */ 763 - force_sig_fault(signal, si_code, (void __user *)address, 764 - tsk); 763 + force_sig_fault(signal, si_code, (void __user *)address); 765 764 } 766 765 767 766 /* ··· 921 922 if (si_code == SEGV_PKUERR) 922 923 force_sig_pkuerr((void __user *)address, pkey); 923 924 924 - force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); 925 + force_sig_fault(SIGSEGV, si_code, (void __user *)address); 925 926 926 927 return; 927 928 } ··· 1018 1019 do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, 1019 1020 vm_fault_t fault) 1020 1021 { 1021 - struct task_struct *tsk = current; 1022 - 1023 1022 /* Kernel mode? Handle exceptions or die: */ 1024 1023 if (!(error_code & X86_PF_USER)) { 1025 1024 no_context(regs, error_code, address, SIGBUS, BUS_ADRERR); ··· 1032 1035 1033 1036 #ifdef CONFIG_MEMORY_FAILURE 1034 1037 if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { 1038 + struct task_struct *tsk = current; 1035 1039 unsigned lsb = 0; 1036 1040 1037 1041 pr_err( ··· 1042 1044 lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault)); 1043 1045 if (fault & VM_FAULT_HWPOISON) 1044 1046 lsb = PAGE_SHIFT; 1045 - force_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, lsb, tsk); 1047 + force_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, lsb); 1046 1048 return; 1047 1049 } 1048 1050 #endif 1049 - force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); 1051 + force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); 1050 1052 } 1051 1053 1052 1054 static noinline void
+1 -1
arch/x86/mm/mpx.c
··· 912 912 913 913 ret = mpx_unmap_tables(mm, start, end); 914 914 if (ret) 915 - force_sig(SIGSEGV, current); 915 + force_sig(SIGSEGV); 916 916 } 917 917 918 918 /* MPX cannot handle addresses above 47 bits yet. */
+2 -2
arch/x86/um/signal.c
··· 471 471 return PT_REGS_SYSCALL_RET(&current->thread.regs); 472 472 473 473 segfault: 474 - force_sig(SIGSEGV, current); 474 + force_sig(SIGSEGV); 475 475 return 0; 476 476 } 477 477 ··· 577 577 return PT_REGS_SYSCALL_RET(&current->thread.regs); 578 578 579 579 segfault: 580 - force_sig(SIGSEGV, current); 580 + force_sig(SIGSEGV); 581 581 return 0; 582 582 }
+1 -1
arch/xtensa/kernel/signal.c
··· 270 270 return ret; 271 271 272 272 badframe: 273 - force_sig(SIGSEGV, current); 273 + force_sig(SIGSEGV); 274 274 return 0; 275 275 } 276 276
+4 -4
arch/xtensa/kernel/traps.c
··· 184 184 "\tEXCCAUSE is %ld\n", 185 185 current->comm, task_pid_nr(current), regs->pc, 186 186 exccause); 187 - force_sig(SIGILL, current); 187 + force_sig(SIGILL); 188 188 } 189 189 190 190 /* ··· 306 306 307 307 pr_info_ratelimited("Illegal Instruction in '%s' (pid = %d, pc = %#010lx)\n", 308 308 current->comm, task_pid_nr(current), regs->pc); 309 - force_sig(SIGILL, current); 309 + force_sig(SIGILL); 310 310 } 311 311 312 312 ··· 330 330 "(pid = %d, pc = %#010lx)\n", 331 331 regs->excvaddr, current->comm, 332 332 task_pid_nr(current), regs->pc); 333 - force_sig_fault(SIGBUS, BUS_ADRALN, (void *) regs->excvaddr, current); 333 + force_sig_fault(SIGBUS, BUS_ADRALN, (void *) regs->excvaddr); 334 334 } 335 335 #endif 336 336 ··· 354 354 355 355 /* If in user mode, send SIGTRAP signal to current process */ 356 356 357 - force_sig(SIGTRAP, current); 357 + force_sig(SIGTRAP); 358 358 } 359 359 360 360
+2 -2
arch/xtensa/mm/fault.c
··· 157 157 if (user_mode(regs)) { 158 158 current->thread.bad_vaddr = address; 159 159 current->thread.error_code = is_write; 160 - force_sig_fault(SIGSEGV, code, (void *) address, current); 160 + force_sig_fault(SIGSEGV, code, (void *) address); 161 161 return; 162 162 } 163 163 bad_page_fault(regs, address, SIGSEGV); ··· 182 182 * or user mode. 183 183 */ 184 184 current->thread.bad_vaddr = address; 185 - force_sig_fault(SIGBUS, BUS_ADRERR, (void *) address, current); 185 + force_sig_fault(SIGBUS, BUS_ADRERR, (void *) address); 186 186 187 187 /* Kernel mode? Handle exceptions or die */ 188 188 if (!user_mode(regs))
+1 -1
drivers/block/drbd/drbd_int.h
··· 1960 1960 { 1961 1961 struct task_struct *task = connection->ack_receiver.task; 1962 1962 if (task && get_t_state(&connection->ack_receiver) == RUNNING) 1963 - force_sig(SIGXCPU, task); 1963 + send_sig(SIGXCPU, task, 1); 1964 1964 } 1965 1965 1966 1966 static inline void request_ping(struct drbd_connection *connection)
+1 -1
drivers/block/drbd/drbd_main.c
··· 465 465 smp_mb(); 466 466 init_completion(&thi->stop); 467 467 if (thi->task != current) 468 - force_sig(DRBD_SIGKILL, thi->task); 468 + send_sig(DRBD_SIGKILL, thi->task, 1); 469 469 } 470 470 471 471 spin_unlock_irqrestore(&thi->t_lock, flags);
+1 -1
drivers/block/drbd/drbd_nl.c
··· 599 599 struct task_struct *opa; 600 600 601 601 kref_get(&connection->kref); 602 - /* We may just have force_sig()'ed this thread 602 + /* We may have just sent a signal to this thread 603 603 * to get it out of some blocking network function. 604 604 * Clear signals; otherwise kthread_run(), which internally uses 605 605 * wait_on_completion_killable(), will mistake our pending signal
+1 -1
drivers/misc/lkdtm/bugs.c
··· 236 236 set_fs(KERNEL_DS); 237 237 238 238 /* Make sure we do not keep running with a KERNEL_DS! */ 239 - force_sig(SIGKILL, current); 239 + force_sig(SIGKILL); 240 240 } 241 241 242 242 /* Test that VMAP_STACK is actually allocating with a leading guard page */
+24 -24
drivers/usb/core/devio.c
··· 63 63 unsigned int discsignr; 64 64 struct pid *disc_pid; 65 65 const struct cred *cred; 66 - void __user *disccontext; 66 + sigval_t disccontext; 67 67 unsigned long ifclaimed; 68 68 u32 disabled_bulk_eps; 69 69 bool privileges_dropped; ··· 90 90 unsigned int ifnum; 91 91 void __user *userbuffer; 92 92 void __user *userurb; 93 + sigval_t userurb_sigval; 93 94 struct urb *urb; 94 95 struct usb_memory *usbm; 95 96 unsigned int mem_usage; ··· 583 582 { 584 583 struct async *as = urb->context; 585 584 struct usb_dev_state *ps = as->ps; 586 - struct kernel_siginfo sinfo; 587 585 struct pid *pid = NULL; 588 586 const struct cred *cred = NULL; 589 587 unsigned long flags; 590 - int signr; 588 + sigval_t addr; 589 + int signr, errno; 591 590 592 591 spin_lock_irqsave(&ps->lock, flags); 593 592 list_move_tail(&as->asynclist, &ps->async_completed); 594 593 as->status = urb->status; 595 594 signr = as->signr; 596 595 if (signr) { 597 - clear_siginfo(&sinfo); 598 - sinfo.si_signo = as->signr; 599 - sinfo.si_errno = as->status; 600 - sinfo.si_code = SI_ASYNCIO; 601 - sinfo.si_addr = as->userurb; 596 + errno = as->status; 597 + addr = as->userurb_sigval; 602 598 pid = get_pid(as->pid); 603 599 cred = get_cred(as->cred); 604 600 } ··· 613 615 spin_unlock_irqrestore(&ps->lock, flags); 614 616 615 617 if (signr) { 616 - kill_pid_info_as_cred(sinfo.si_signo, &sinfo, pid, cred); 618 + kill_pid_usb_asyncio(signr, errno, addr, pid, cred); 617 619 put_pid(pid); 618 620 put_cred(cred); 619 621 } ··· 1425 1427 1426 1428 static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb, 1427 1429 struct usbdevfs_iso_packet_desc __user *iso_frame_desc, 1428 - void __user *arg) 1430 + void __user *arg, sigval_t userurb_sigval) 1429 1431 { 1430 1432 struct usbdevfs_iso_packet_desc *isopkt = NULL; 1431 1433 struct usb_host_endpoint *ep; ··· 1725 1727 isopkt = NULL; 1726 1728 as->ps = ps; 1727 1729 as->userurb = arg; 1730 + as->userurb_sigval = userurb_sigval; 1728 1731 if (as->usbm) { 1729 1732 unsigned long uurb_start = (unsigned long)uurb->buffer; 1730 1733 ··· 1800 1801 static int proc_submiturb(struct usb_dev_state *ps, void __user *arg) 1801 1802 { 1802 1803 struct usbdevfs_urb uurb; 1804 + sigval_t userurb_sigval; 1803 1805 1804 1806 if (copy_from_user(&uurb, arg, sizeof(uurb))) 1805 1807 return -EFAULT; 1806 1808 1809 + memset(&userurb_sigval, 0, sizeof(userurb_sigval)); 1810 + userurb_sigval.sival_ptr = arg; 1811 + 1807 1812 return proc_do_submiturb(ps, &uurb, 1808 1813 (((struct usbdevfs_urb __user *)arg)->iso_frame_desc), 1809 - arg); 1814 + arg, userurb_sigval); 1810 1815 } 1811 1816 1812 1817 static int proc_unlinkurb(struct usb_dev_state *ps, void __user *arg) ··· 1980 1977 if (copy_from_user(&ds, arg, sizeof(ds))) 1981 1978 return -EFAULT; 1982 1979 ps->discsignr = ds.signr; 1983 - ps->disccontext = compat_ptr(ds.context); 1980 + ps->disccontext.sival_int = ds.context; 1984 1981 return 0; 1985 1982 } 1986 1983 ··· 2008 2005 static int proc_submiturb_compat(struct usb_dev_state *ps, void __user *arg) 2009 2006 { 2010 2007 struct usbdevfs_urb uurb; 2008 + sigval_t userurb_sigval; 2011 2009 2012 2010 if (get_urb32(&uurb, (struct usbdevfs_urb32 __user *)arg)) 2013 2011 return -EFAULT; 2014 2012 2013 + memset(&userurb_sigval, 0, sizeof(userurb_sigval)); 2014 + userurb_sigval.sival_int = ptr_to_compat(arg); 2015 + 2015 2016 return proc_do_submiturb(ps, &uurb, 2016 2017 ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, 2017 - arg); 2018 + arg, userurb_sigval); 2018 2019 } 2019 2020 2020 2021 static int processcompl_compat(struct async *as, void __user * __user *arg) ··· 2099 2092 if (copy_from_user(&ds, arg, sizeof(ds))) 2100 2093 return -EFAULT; 2101 2094 ps->discsignr = ds.signr; 2102 - ps->disccontext = ds.context; 2095 + ps->disccontext.sival_ptr = ds.context; 2103 2096 return 0; 2104 2097 } 2105 2098 ··· 2621 2614 static void usbdev_remove(struct usb_device *udev) 2622 2615 { 2623 2616 struct usb_dev_state *ps; 2624 - struct kernel_siginfo sinfo; 2625 2617 2626 2618 while (!list_empty(&udev->filelist)) { 2627 2619 ps = list_entry(udev->filelist.next, struct usb_dev_state, list); 2628 2620 destroy_all_async(ps); 2629 2621 wake_up_all(&ps->wait); 2630 2622 list_del_init(&ps->list); 2631 - if (ps->discsignr) { 2632 - clear_siginfo(&sinfo); 2633 - sinfo.si_signo = ps->discsignr; 2634 - sinfo.si_errno = EPIPE; 2635 - sinfo.si_code = SI_ASYNCIO; 2636 - sinfo.si_addr = ps->disccontext; 2637 - kill_pid_info_as_cred(ps->discsignr, &sinfo, 2638 - ps->disc_pid, ps->cred); 2639 - } 2623 + if (ps->discsignr) 2624 + kill_pid_usb_asyncio(ps->discsignr, EPIPE, ps->disccontext, 2625 + ps->disc_pid, ps->cred); 2640 2626 } 2641 2627 } 2642 2628
+1 -1
fs/cifs/connect.c
··· 2631 2631 2632 2632 task = xchg(&server->tsk, NULL); 2633 2633 if (task) 2634 - force_sig(SIGKILL, task); 2634 + send_sig(SIGKILL, task, 1); 2635 2635 } 2636 2636 2637 2637 static struct TCP_Server_Info *
+1 -1
fs/exec.c
··· 1663 1663 if (retval < 0 && !bprm->mm) { 1664 1664 /* we got to flush_old_exec() and failed after it */ 1665 1665 read_unlock(&binfmt_lock); 1666 - force_sigsegv(SIGSEGV, current); 1666 + force_sigsegv(SIGSEGV); 1667 1667 return retval; 1668 1668 } 1669 1669 if (retval != -ENOEXEC || !bprm->file) {
+1 -1
include/linux/ptrace.h
··· 355 355 info.si_code = SI_USER; 356 356 info.si_pid = 0; 357 357 info.si_uid = 0; 358 - force_sig_info(info.si_signo, &info, current); 358 + force_sig_info(&info); 359 359 } 360 360 #endif 361 361
+9 -6
include/linux/sched/signal.h
··· 307 307 # define ___ARCH_SI_IA64(_a1, _a2, _a3) 308 308 #endif 309 309 310 - int force_sig_fault(int sig, int code, void __user *addr 310 + int force_sig_fault_to_task(int sig, int code, void __user *addr 311 311 ___ARCH_SI_TRAPNO(int trapno) 312 312 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) 313 313 , struct task_struct *t); 314 + int force_sig_fault(int sig, int code, void __user *addr 315 + ___ARCH_SI_TRAPNO(int trapno) 316 + ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)); 314 317 int send_sig_fault(int sig, int code, void __user *addr 315 318 ___ARCH_SI_TRAPNO(int trapno) 316 319 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) 317 320 , struct task_struct *t); 318 321 319 - int force_sig_mceerr(int code, void __user *, short, struct task_struct *); 322 + int force_sig_mceerr(int code, void __user *, short); 320 323 int send_sig_mceerr(int code, void __user *, short, struct task_struct *); 321 324 322 325 int force_sig_bnderr(void __user *addr, void __user *lower, void __user *upper); ··· 328 325 int force_sig_ptrace_errno_trap(int errno, void __user *addr); 329 326 330 327 extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *); 331 - extern void force_sigsegv(int sig, struct task_struct *p); 332 - extern int force_sig_info(int, struct kernel_siginfo *, struct task_struct *); 328 + extern void force_sigsegv(int sig); 329 + extern int force_sig_info(struct kernel_siginfo *); 333 330 extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp); 334 331 extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid); 335 - extern int kill_pid_info_as_cred(int, struct kernel_siginfo *, struct pid *, 332 + extern int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, struct pid *, 336 333 const struct cred *); 337 334 extern int kill_pgrp(struct pid *pid, int sig, int priv); 338 335 extern int kill_pid(struct pid *pid, int sig, int priv); 339 336 extern __must_check bool do_notify_parent(struct task_struct *, int); 340 337 extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); 341 - extern void force_sig(int, struct task_struct *); 338 + extern void force_sig(int); 342 339 extern int send_sig(int, struct task_struct *, int); 343 340 extern int zap_other_threads(struct task_struct *p); 344 341 extern struct sigqueue *sigqueue_alloc(void);
+1 -1
include/linux/syscalls.h
··· 264 264 265 265 if (CHECK_DATA_CORRUPTION(!segment_eq(get_fs(), USER_DS), 266 266 "Invalid address limit on user-mode return")) 267 - force_sig(SIGKILL, current); 267 + force_sig(SIGKILL); 268 268 269 269 #ifdef TIF_FSCHECK 270 270 clear_thread_flag(TIF_FSCHECK);
+2 -2
kernel/events/uprobes.c
··· 2112 2112 2113 2113 sigill: 2114 2114 uprobe_warn(current, "handle uretprobe, sending SIGILL."); 2115 - force_sig(SIGILL, current); 2115 + force_sig(SIGILL); 2116 2116 2117 2117 } 2118 2118 ··· 2228 2228 2229 2229 if (unlikely(err)) { 2230 2230 uprobe_warn(current, "execute the probed insn, sending SIGILL."); 2231 - force_sig(SIGILL, current); 2231 + force_sig(SIGILL); 2232 2232 } 2233 2233 } 2234 2234
+1 -1
kernel/pid_namespace.c
··· 326 326 } 327 327 328 328 read_lock(&tasklist_lock); 329 - force_sig(SIGKILL, pid_ns->child_reaper); 329 + send_sig(SIGKILL, pid_ns->child_reaper, 1); 330 330 read_unlock(&tasklist_lock); 331 331 332 332 do_exit(0);
+2 -2
kernel/rseq.c
··· 277 277 278 278 error: 279 279 sig = ksig ? ksig->sig : 0; 280 - force_sigsegv(sig, t); 280 + force_sigsegv(sig); 281 281 } 282 282 283 283 #ifdef CONFIG_DEBUG_RSEQ ··· 296 296 return; 297 297 if (!access_ok(t->rseq, sizeof(*t->rseq)) || 298 298 rseq_get_rseq_cs(t, &rseq_cs) || in_rseq_cs(ip, &rseq_cs)) 299 - force_sig(SIGSEGV, t); 299 + force_sig(SIGSEGV); 300 300 } 301 301 302 302 #endif
+1 -1
kernel/seccomp.c
··· 609 609 { 610 610 struct kernel_siginfo info; 611 611 seccomp_init_siginfo(&info, syscall, reason); 612 - force_sig_info(SIGSYS, &info, current); 612 + force_sig_info(&info); 613 613 } 614 614 #endif /* CONFIG_SECCOMP_FILTER */ 615 615
+174 -75
kernel/signal.c
··· 1057 1057 return (sig < SIGRTMIN) && sigismember(&signals->signal, sig); 1058 1058 } 1059 1059 1060 - #ifdef CONFIG_USER_NS 1061 - static inline void userns_fixup_signal_uid(struct kernel_siginfo *info, struct task_struct *t) 1062 - { 1063 - if (current_user_ns() == task_cred_xxx(t, user_ns)) 1064 - return; 1065 - 1066 - if (SI_FROMKERNEL(info)) 1067 - return; 1068 - 1069 - rcu_read_lock(); 1070 - info->si_uid = from_kuid_munged(task_cred_xxx(t, user_ns), 1071 - make_kuid(current_user_ns(), info->si_uid)); 1072 - rcu_read_unlock(); 1073 - } 1074 - #else 1075 - static inline void userns_fixup_signal_uid(struct kernel_siginfo *info, struct task_struct *t) 1076 - { 1077 - return; 1078 - } 1079 - #endif 1080 - 1081 1060 static int __send_signal(int sig, struct kernel_siginfo *info, struct task_struct *t, 1082 - enum pid_type type, int from_ancestor_ns) 1061 + enum pid_type type, bool force) 1083 1062 { 1084 1063 struct sigpending *pending; 1085 1064 struct sigqueue *q; ··· 1068 1089 assert_spin_locked(&t->sighand->siglock); 1069 1090 1070 1091 result = TRACE_SIGNAL_IGNORED; 1071 - if (!prepare_signal(sig, t, 1072 - from_ancestor_ns || (info == SEND_SIG_PRIV))) 1092 + if (!prepare_signal(sig, t, force)) 1073 1093 goto ret; 1074 1094 1075 1095 pending = (type != PIDTYPE_PID) ? &t->signal->shared_pending : &t->pending; ··· 1113 1135 q->info.si_code = SI_USER; 1114 1136 q->info.si_pid = task_tgid_nr_ns(current, 1115 1137 task_active_pid_ns(t)); 1116 - q->info.si_uid = from_kuid_munged(current_user_ns(), current_uid()); 1138 + rcu_read_lock(); 1139 + q->info.si_uid = 1140 + from_kuid_munged(task_cred_xxx(t, user_ns), 1141 + current_uid()); 1142 + rcu_read_unlock(); 1117 1143 break; 1118 1144 case (unsigned long) SEND_SIG_PRIV: 1119 1145 clear_siginfo(&q->info); ··· 1129 1147 break; 1130 1148 default: 1131 1149 copy_siginfo(&q->info, info); 1132 - if (from_ancestor_ns) 1133 - q->info.si_pid = 0; 1134 1150 break; 1135 1151 } 1136 - 1137 - userns_fixup_signal_uid(&q->info, t); 1138 - 1139 - } else if (!is_si_special(info)) { 1140 - if (sig >= SIGRTMIN && info->si_code != SI_USER) { 1141 - /* 1142 - * Queue overflow, abort. We may abort if the 1143 - * signal was rt and sent by user using something 1144 - * other than kill(). 1145 - */ 1146 - result = TRACE_SIGNAL_OVERFLOW_FAIL; 1147 - ret = -EAGAIN; 1148 - goto ret; 1149 - } else { 1150 - /* 1151 - * This is a silent loss of information. We still 1152 - * send the signal, but the *info bits are lost. 1153 - */ 1154 - result = TRACE_SIGNAL_LOSE_INFO; 1155 - } 1152 + } else if (!is_si_special(info) && 1153 + sig >= SIGRTMIN && info->si_code != SI_USER) { 1154 + /* 1155 + * Queue overflow, abort. We may abort if the 1156 + * signal was rt and sent by user using something 1157 + * other than kill(). 1158 + */ 1159 + result = TRACE_SIGNAL_OVERFLOW_FAIL; 1160 + ret = -EAGAIN; 1161 + goto ret; 1162 + } else { 1163 + /* 1164 + * This is a silent loss of information. We still 1165 + * send the signal, but the *info bits are lost. 1166 + */ 1167 + result = TRACE_SIGNAL_LOSE_INFO; 1156 1168 } 1157 1169 1158 1170 out_set: ··· 1173 1197 return ret; 1174 1198 } 1175 1199 1200 + static inline bool has_si_pid_and_uid(struct kernel_siginfo *info) 1201 + { 1202 + bool ret = false; 1203 + switch (siginfo_layout(info->si_signo, info->si_code)) { 1204 + case SIL_KILL: 1205 + case SIL_CHLD: 1206 + case SIL_RT: 1207 + ret = true; 1208 + break; 1209 + case SIL_TIMER: 1210 + case SIL_POLL: 1211 + case SIL_FAULT: 1212 + case SIL_FAULT_MCEERR: 1213 + case SIL_FAULT_BNDERR: 1214 + case SIL_FAULT_PKUERR: 1215 + case SIL_SYS: 1216 + ret = false; 1217 + break; 1218 + } 1219 + return ret; 1220 + } 1221 + 1176 1222 static int send_signal(int sig, struct kernel_siginfo *info, struct task_struct *t, 1177 1223 enum pid_type type) 1178 1224 { 1179 - int from_ancestor_ns = 0; 1225 + /* Should SIGKILL or SIGSTOP be received by a pid namespace init? */ 1226 + bool force = false; 1180 1227 1181 - #ifdef CONFIG_PID_NS 1182 - from_ancestor_ns = si_fromuser(info) && 1183 - !task_pid_nr_ns(current, task_active_pid_ns(t)); 1184 - #endif 1228 + if (info == SEND_SIG_NOINFO) { 1229 + /* Force if sent from an ancestor pid namespace */ 1230 + force = !task_pid_nr_ns(current, task_active_pid_ns(t)); 1231 + } else if (info == SEND_SIG_PRIV) { 1232 + /* Don't ignore kernel generated signals */ 1233 + force = true; 1234 + } else if (has_si_pid_and_uid(info)) { 1235 + /* SIGKILL and SIGSTOP is special or has ids */ 1236 + struct user_namespace *t_user_ns; 1185 1237 1186 - return __send_signal(sig, info, t, type, from_ancestor_ns); 1238 + rcu_read_lock(); 1239 + t_user_ns = task_cred_xxx(t, user_ns); 1240 + if (current_user_ns() != t_user_ns) { 1241 + kuid_t uid = make_kuid(current_user_ns(), info->si_uid); 1242 + info->si_uid = from_kuid_munged(t_user_ns, uid); 1243 + } 1244 + rcu_read_unlock(); 1245 + 1246 + /* A kernel generated signal? */ 1247 + force = (info->si_code == SI_KERNEL); 1248 + 1249 + /* From an ancestor pid namespace? */ 1250 + if (!task_pid_nr_ns(current, task_active_pid_ns(t))) { 1251 + info->si_pid = 0; 1252 + force = true; 1253 + } 1254 + } 1255 + return __send_signal(sig, info, t, type, force); 1187 1256 } 1188 1257 1189 1258 static void print_fatal_signal(int signr) ··· 1295 1274 * We don't want to have recursive SIGSEGV's etc, for example, 1296 1275 * that is why we also clear SIGNAL_UNKILLABLE. 1297 1276 */ 1298 - int 1299 - force_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *t) 1277 + static int 1278 + force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t) 1300 1279 { 1301 1280 unsigned long int flags; 1302 1281 int ret, blocked, ignored; 1303 1282 struct k_sigaction *action; 1283 + int sig = info->si_signo; 1304 1284 1305 1285 spin_lock_irqsave(&t->sighand->siglock, flags); 1306 1286 action = &t->sighand->action[sig-1]; ··· 1324 1302 spin_unlock_irqrestore(&t->sighand->siglock, flags); 1325 1303 1326 1304 return ret; 1305 + } 1306 + 1307 + int force_sig_info(struct kernel_siginfo *info) 1308 + { 1309 + return force_sig_info_to_task(info, current); 1327 1310 } 1328 1311 1329 1312 /* ··· 1467 1440 uid_eq(cred->uid, pcred->uid); 1468 1441 } 1469 1442 1470 - /* like kill_pid_info(), but doesn't use uid/euid of "current" */ 1471 - int kill_pid_info_as_cred(int sig, struct kernel_siginfo *info, struct pid *pid, 1472 - const struct cred *cred) 1443 + /* 1444 + * The usb asyncio usage of siginfo is wrong. The glibc support 1445 + * for asyncio which uses SI_ASYNCIO assumes the layout is SIL_RT. 1446 + * AKA after the generic fields: 1447 + * kernel_pid_t si_pid; 1448 + * kernel_uid32_t si_uid; 1449 + * sigval_t si_value; 1450 + * 1451 + * Unfortunately when usb generates SI_ASYNCIO it assumes the layout 1452 + * after the generic fields is: 1453 + * void __user *si_addr; 1454 + * 1455 + * This is a practical problem when there is a 64bit big endian kernel 1456 + * and a 32bit userspace. As the 32bit address will encoded in the low 1457 + * 32bits of the pointer. Those low 32bits will be stored at higher 1458 + * address than appear in a 32 bit pointer. So userspace will not 1459 + * see the address it was expecting for it's completions. 1460 + * 1461 + * There is nothing in the encoding that can allow 1462 + * copy_siginfo_to_user32 to detect this confusion of formats, so 1463 + * handle this by requiring the caller of kill_pid_usb_asyncio to 1464 + * notice when this situration takes place and to store the 32bit 1465 + * pointer in sival_int, instead of sival_addr of the sigval_t addr 1466 + * parameter. 1467 + */ 1468 + int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, 1469 + struct pid *pid, const struct cred *cred) 1473 1470 { 1474 - int ret = -EINVAL; 1471 + struct kernel_siginfo info; 1475 1472 struct task_struct *p; 1476 1473 unsigned long flags; 1474 + int ret = -EINVAL; 1475 + 1476 + clear_siginfo(&info); 1477 + info.si_signo = sig; 1478 + info.si_errno = errno; 1479 + info.si_code = SI_ASYNCIO; 1480 + *((sigval_t *)&info.si_pid) = addr; 1477 1481 1478 1482 if (!valid_signal(sig)) 1479 1483 return ret; ··· 1515 1457 ret = -ESRCH; 1516 1458 goto out_unlock; 1517 1459 } 1518 - if (si_fromuser(info) && !kill_as_cred_perm(cred, p)) { 1460 + if (!kill_as_cred_perm(cred, p)) { 1519 1461 ret = -EPERM; 1520 1462 goto out_unlock; 1521 1463 } 1522 - ret = security_task_kill(p, info, sig, cred); 1464 + ret = security_task_kill(p, &info, sig, cred); 1523 1465 if (ret) 1524 1466 goto out_unlock; 1525 1467 1526 1468 if (sig) { 1527 1469 if (lock_task_sighand(p, &flags)) { 1528 - ret = __send_signal(sig, info, p, PIDTYPE_TGID, 0); 1470 + ret = __send_signal(sig, &info, p, PIDTYPE_TGID, false); 1529 1471 unlock_task_sighand(p, &flags); 1530 1472 } else 1531 1473 ret = -ESRCH; ··· 1534 1476 rcu_read_unlock(); 1535 1477 return ret; 1536 1478 } 1537 - EXPORT_SYMBOL_GPL(kill_pid_info_as_cred); 1479 + EXPORT_SYMBOL_GPL(kill_pid_usb_asyncio); 1538 1480 1539 1481 /* 1540 1482 * kill_something_info() interprets pid in interesting ways just like kill(2). ··· 1610 1552 } 1611 1553 EXPORT_SYMBOL(send_sig); 1612 1554 1613 - void force_sig(int sig, struct task_struct *p) 1555 + void force_sig(int sig) 1614 1556 { 1615 - force_sig_info(sig, SEND_SIG_PRIV, p); 1557 + struct kernel_siginfo info; 1558 + 1559 + clear_siginfo(&info); 1560 + info.si_signo = sig; 1561 + info.si_errno = 0; 1562 + info.si_code = SI_KERNEL; 1563 + info.si_pid = 0; 1564 + info.si_uid = 0; 1565 + force_sig_info(&info); 1616 1566 } 1617 1567 EXPORT_SYMBOL(force_sig); 1618 1568 ··· 1630 1564 * the problem was already a SIGSEGV, we'll want to 1631 1565 * make sure we don't even try to deliver the signal.. 1632 1566 */ 1633 - void force_sigsegv(int sig, struct task_struct *p) 1567 + void force_sigsegv(int sig) 1634 1568 { 1569 + struct task_struct *p = current; 1570 + 1635 1571 if (sig == SIGSEGV) { 1636 1572 unsigned long flags; 1637 1573 spin_lock_irqsave(&p->sighand->siglock, flags); 1638 1574 p->sighand->action[sig - 1].sa.sa_handler = SIG_DFL; 1639 1575 spin_unlock_irqrestore(&p->sighand->siglock, flags); 1640 1576 } 1641 - force_sig(SIGSEGV, p); 1577 + force_sig(SIGSEGV); 1642 1578 } 1643 1579 1644 - int force_sig_fault(int sig, int code, void __user *addr 1580 + int force_sig_fault_to_task(int sig, int code, void __user *addr 1645 1581 ___ARCH_SI_TRAPNO(int trapno) 1646 1582 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) 1647 1583 , struct task_struct *t) ··· 1663 1595 info.si_flags = flags; 1664 1596 info.si_isr = isr; 1665 1597 #endif 1666 - return force_sig_info(info.si_signo, &info, t); 1598 + return force_sig_info_to_task(&info, t); 1599 + } 1600 + 1601 + int force_sig_fault(int sig, int code, void __user *addr 1602 + ___ARCH_SI_TRAPNO(int trapno) 1603 + ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)) 1604 + { 1605 + return force_sig_fault_to_task(sig, code, addr 1606 + ___ARCH_SI_TRAPNO(trapno) 1607 + ___ARCH_SI_IA64(imm, flags, isr), current); 1667 1608 } 1668 1609 1669 1610 int send_sig_fault(int sig, int code, void __user *addr ··· 1698 1621 return send_sig_info(info.si_signo, &info, t); 1699 1622 } 1700 1623 1701 - int force_sig_mceerr(int code, void __user *addr, short lsb, struct task_struct *t) 1624 + int force_sig_mceerr(int code, void __user *addr, short lsb) 1702 1625 { 1703 1626 struct kernel_siginfo info; 1704 1627 ··· 1709 1632 info.si_code = code; 1710 1633 info.si_addr = addr; 1711 1634 info.si_addr_lsb = lsb; 1712 - return force_sig_info(info.si_signo, &info, t); 1635 + return force_sig_info(&info); 1713 1636 } 1714 1637 1715 1638 int send_sig_mceerr(int code, void __user *addr, short lsb, struct task_struct *t) ··· 1738 1661 info.si_addr = addr; 1739 1662 info.si_lower = lower; 1740 1663 info.si_upper = upper; 1741 - return force_sig_info(info.si_signo, &info, current); 1664 + return force_sig_info(&info); 1742 1665 } 1743 1666 1744 1667 #ifdef SEGV_PKUERR ··· 1752 1675 info.si_code = SEGV_PKUERR; 1753 1676 info.si_addr = addr; 1754 1677 info.si_pkey = pkey; 1755 - return force_sig_info(info.si_signo, &info, current); 1678 + return force_sig_info(&info); 1756 1679 } 1757 1680 #endif 1758 1681 ··· 1768 1691 info.si_errno = errno; 1769 1692 info.si_code = TRAP_HWBKPT; 1770 1693 info.si_addr = addr; 1771 - return force_sig_info(info.si_signo, &info, current); 1694 + return force_sig_info(&info); 1772 1695 } 1773 1696 1774 1697 int kill_pgrp(struct pid *pid, int sig, int priv) ··· 2753 2676 void signal_setup_done(int failed, struct ksignal *ksig, int stepping) 2754 2677 { 2755 2678 if (failed) 2756 - force_sigsegv(ksig->sig, current); 2679 + force_sigsegv(ksig->sig); 2757 2680 else 2758 2681 signal_delivered(ksig, stepping); 2759 2682 } ··· 4554 4477 CHECK_OFFSET(si_syscall); 4555 4478 CHECK_OFFSET(si_arch); 4556 4479 #undef CHECK_OFFSET 4480 + 4481 + /* usb asyncio */ 4482 + BUILD_BUG_ON(offsetof(struct siginfo, si_pid) != 4483 + offsetof(struct siginfo, si_addr)); 4484 + if (sizeof(int) == sizeof(void __user *)) { 4485 + BUILD_BUG_ON(sizeof_field(struct siginfo, si_pid) != 4486 + sizeof(void __user *)); 4487 + } else { 4488 + BUILD_BUG_ON((sizeof_field(struct siginfo, si_pid) + 4489 + sizeof_field(struct siginfo, si_uid)) != 4490 + sizeof(void __user *)); 4491 + BUILD_BUG_ON(offsetofend(struct siginfo, si_pid) != 4492 + offsetof(struct siginfo, si_uid)); 4493 + } 4494 + #ifdef CONFIG_COMPAT 4495 + BUILD_BUG_ON(offsetof(struct compat_siginfo, si_pid) != 4496 + offsetof(struct compat_siginfo, si_addr)); 4497 + BUILD_BUG_ON(sizeof_field(struct compat_siginfo, si_pid) != 4498 + sizeof(compat_uptr_t)); 4499 + BUILD_BUG_ON(sizeof_field(struct compat_siginfo, si_pid) != 4500 + sizeof_field(struct siginfo, si_pid)); 4501 + #endif 4557 4502 } 4558 4503 4559 4504 void __init signals_init(void)
+1 -1
mm/memory-failure.c
··· 218 218 219 219 if ((flags & MF_ACTION_REQUIRED) && t->mm == current->mm) { 220 220 ret = force_sig_mceerr(BUS_MCEERR_AR, (void __user *)tk->addr, 221 - addr_lsb, current); 221 + addr_lsb); 222 222 } else { 223 223 /* 224 224 * Don't use force here, it's convenient if the signal
+1 -1
net/bpfilter/bpfilter_kern.c
··· 22 22 23 23 tsk = get_pid_task(find_vpid(bpfilter_ops.info.pid), PIDTYPE_PID); 24 24 if (tsk) { 25 - force_sig(SIGKILL, tsk); 25 + send_sig(SIGKILL, tsk, 1); 26 26 put_task_struct(tsk); 27 27 } 28 28 }
+2 -2
security/safesetid/lsm.c
··· 111 111 * that could arise from a missing whitelist entry preventing a 112 112 * privileged process from dropping to a lesser-privileged one. 113 113 */ 114 - force_sig(SIGKILL, current); 114 + force_sig(SIGKILL); 115 115 return -EACCES; 116 116 } 117 117 ··· 203 203 break; 204 204 default: 205 205 pr_warn("Unknown setid state %d\n", flags); 206 - force_sig(SIGKILL, current); 206 + force_sig(SIGKILL); 207 207 return -EINVAL; 208 208 } 209 209 return 0;