signal: Remove task parameter from force_sig
All of the remaining callers pass current into force_sig so remove the task parameter to make this obvious and to make misuse more difficult in the future. This also makes it clear force_sig passes current into force_sig_info. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
@@ -32,7 +32,7 @@ int __isa_exception_epc(struct pt_regs *regs)
|
||||
/* Calculate exception PC in branch delay slot. */
|
||||
if (__get_user(inst, (u16 __user *) msk_isa16_mode(epc))) {
|
||||
/* This should never happen because delay slot was checked. */
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
return epc;
|
||||
}
|
||||
if (cpu_has_mips16) {
|
||||
@@ -305,7 +305,7 @@ int __microMIPS_compute_return_epc(struct pt_regs *regs)
|
||||
return 0;
|
||||
|
||||
sigsegv:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ int __MIPS16e_compute_return_epc(struct pt_regs *regs)
|
||||
/* Read the instruction. */
|
||||
addr = (u16 __user *)msk_isa16_mode(epc);
|
||||
if (__get_user(inst.full, addr)) {
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ int __MIPS16e_compute_return_epc(struct pt_regs *regs)
|
||||
case MIPS16e_jal_op:
|
||||
addr += 1;
|
||||
if (__get_user(inst2, addr)) {
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
return -EFAULT;
|
||||
}
|
||||
fullinst = ((unsigned)inst.full << 16) | inst2;
|
||||
@@ -829,17 +829,17 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||
sigill_dsp:
|
||||
pr_debug("%s: DSP branch but not DSP ASE - sending SIGILL.\n",
|
||||
current->comm);
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
return -EFAULT;
|
||||
sigill_r2r6:
|
||||
pr_debug("%s: R2 branch but r2-to-r6 emulator is not present - sending SIGILL.\n",
|
||||
current->comm);
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
return -EFAULT;
|
||||
sigill_r6:
|
||||
pr_debug("%s: R6 branch but no MIPSr6 ISA support - sending SIGILL.\n",
|
||||
current->comm);
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
return -EFAULT;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__compute_return_epc_for_insn);
|
||||
@@ -859,7 +859,7 @@ int __compute_return_epc(struct pt_regs *regs)
|
||||
*/
|
||||
addr = (unsigned int __user *) epc;
|
||||
if (__get_user(insn.word, addr)) {
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ int __compute_return_epc(struct pt_regs *regs)
|
||||
|
||||
unaligned:
|
||||
printk("%s: unaligned epc - sending SIGBUS.\n", current->comm);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
@@ -232,7 +232,7 @@ static int evaluate_branch_instruction(struct kprobe *p, struct pt_regs *regs,
|
||||
|
||||
unaligned:
|
||||
pr_notice("%s: unaligned epc - sending SIGBUS.\n", current->comm);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
return -EFAULT;
|
||||
|
||||
}
|
||||
|
@@ -641,7 +641,7 @@ asmlinkage void sys_sigreturn(void)
|
||||
if (sig < 0)
|
||||
goto badframe;
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
force_sig(sig);
|
||||
|
||||
/*
|
||||
* Don't let your children do this ...
|
||||
@@ -654,7 +654,7 @@ asmlinkage void sys_sigreturn(void)
|
||||
/* Unreached */
|
||||
|
||||
badframe:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
}
|
||||
#endif /* CONFIG_TRAD_SIGNALS */
|
||||
|
||||
@@ -678,7 +678,7 @@ asmlinkage void sys_rt_sigreturn(void)
|
||||
if (sig < 0)
|
||||
goto badframe;
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
force_sig(sig);
|
||||
|
||||
if (restore_altstack(&frame->rs_uc.uc_stack))
|
||||
goto badframe;
|
||||
@@ -694,7 +694,7 @@ asmlinkage void sys_rt_sigreturn(void)
|
||||
/* Unreached */
|
||||
|
||||
badframe:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TRAD_SIGNALS
|
||||
|
@@ -84,7 +84,7 @@ asmlinkage void sysn32_rt_sigreturn(void)
|
||||
if (sig < 0)
|
||||
goto badframe;
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
force_sig(sig);
|
||||
|
||||
if (compat_restore_altstack(&frame->rs_uc.uc_stack))
|
||||
goto badframe;
|
||||
@@ -100,7 +100,7 @@ asmlinkage void sysn32_rt_sigreturn(void)
|
||||
/* Unreached */
|
||||
|
||||
badframe:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
}
|
||||
|
||||
static int setup_rt_frame_n32(void *sig_return, struct ksignal *ksig,
|
||||
|
@@ -171,7 +171,7 @@ asmlinkage void sys32_rt_sigreturn(void)
|
||||
if (sig < 0)
|
||||
goto badframe;
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
force_sig(sig);
|
||||
|
||||
if (compat_restore_altstack(&frame->rs_uc.uc_stack))
|
||||
goto badframe;
|
||||
@@ -187,7 +187,7 @@ asmlinkage void sys32_rt_sigreturn(void)
|
||||
/* Unreached */
|
||||
|
||||
badframe:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
}
|
||||
|
||||
static int setup_rt_frame_32(void *sig_return, struct ksignal *ksig,
|
||||
@@ -273,7 +273,7 @@ asmlinkage void sys32_sigreturn(void)
|
||||
if (sig < 0)
|
||||
goto badframe;
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
force_sig(sig);
|
||||
|
||||
/*
|
||||
* Don't let your children do this ...
|
||||
@@ -286,5 +286,5 @@ asmlinkage void sys32_sigreturn(void)
|
||||
/* Unreached */
|
||||
|
||||
badframe:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
}
|
||||
|
@@ -482,7 +482,7 @@ asmlinkage void do_be(struct pt_regs *regs)
|
||||
goto out;
|
||||
|
||||
die_if_kernel("Oops", regs);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
@@ -765,7 +765,7 @@ int process_fpemu_return(int sig, void __user *fault_addr, unsigned long fcr31)
|
||||
return 1;
|
||||
|
||||
default:
|
||||
force_sig(sig, current);
|
||||
force_sig(sig);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -947,7 +947,7 @@ void do_trap_or_bp(struct pt_regs *regs, unsigned int code, int si_code,
|
||||
break;
|
||||
case BRK_BUG:
|
||||
die_if_kernel("Kernel bug detected", regs);
|
||||
force_sig(SIGTRAP, current);
|
||||
force_sig(SIGTRAP);
|
||||
break;
|
||||
case BRK_MEMU:
|
||||
/*
|
||||
@@ -962,7 +962,7 @@ void do_trap_or_bp(struct pt_regs *regs, unsigned int code, int si_code,
|
||||
return;
|
||||
|
||||
die_if_kernel("Math emu break/trap", regs);
|
||||
force_sig(SIGTRAP, current);
|
||||
force_sig(SIGTRAP);
|
||||
break;
|
||||
default:
|
||||
scnprintf(b, sizeof(b), "%s instruction in kernel code", str);
|
||||
@@ -970,7 +970,7 @@ void do_trap_or_bp(struct pt_regs *regs, unsigned int code, int si_code,
|
||||
if (si_code) {
|
||||
force_sig_fault(SIGTRAP, si_code, NULL, current);
|
||||
} else {
|
||||
force_sig(SIGTRAP, current);
|
||||
force_sig(SIGTRAP);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1063,7 +1063,7 @@ out:
|
||||
return;
|
||||
|
||||
out_sigsegv:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1105,7 +1105,7 @@ out:
|
||||
return;
|
||||
|
||||
out_sigsegv:
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1191,7 +1191,7 @@ no_r2_instr:
|
||||
if (unlikely(status > 0)) {
|
||||
regs->cp0_epc = old_epc; /* Undo skip-over. */
|
||||
regs->regs[31] = old31;
|
||||
force_sig(status, current);
|
||||
force_sig(status);
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -1220,7 +1220,7 @@ static int default_cu2_call(struct notifier_block *nfb, unsigned long action,
|
||||
|
||||
die_if_kernel("COP2: Unhandled kernel unaligned access or invalid "
|
||||
"instruction", regs);
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
@@ -1383,7 +1383,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
|
||||
if (unlikely(status > 0)) {
|
||||
regs->cp0_epc = old_epc; /* Undo skip-over. */
|
||||
regs->regs[31] = old31;
|
||||
force_sig(status, current);
|
||||
force_sig(status);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1403,7 +1403,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
|
||||
* emulator too.
|
||||
*/
|
||||
if (raw_cpu_has_fpu || !cpu_has_mips_4_5_64_r2_r6) {
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
break;
|
||||
}
|
||||
/* Fall through. */
|
||||
@@ -1437,7 +1437,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
|
||||
#else /* CONFIG_MIPS_FP_SUPPORT */
|
||||
case 1:
|
||||
case 3:
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
break;
|
||||
#endif /* CONFIG_MIPS_FP_SUPPORT */
|
||||
|
||||
@@ -1464,7 +1464,7 @@ asmlinkage void do_msa_fpe(struct pt_regs *regs, unsigned int msacsr)
|
||||
local_irq_enable();
|
||||
|
||||
die_if_kernel("do_msa_fpe invoked from kernel context!", regs);
|
||||
force_sig(SIGFPE, current);
|
||||
force_sig(SIGFPE);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -1477,7 +1477,7 @@ asmlinkage void do_msa(struct pt_regs *regs)
|
||||
prev_state = exception_enter();
|
||||
|
||||
if (!cpu_has_msa || test_thread_flag(TIF_32BIT_FPREGS)) {
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1485,7 +1485,7 @@ asmlinkage void do_msa(struct pt_regs *regs)
|
||||
|
||||
err = enable_restore_fp_context(1);
|
||||
if (err)
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -1495,7 +1495,7 @@ asmlinkage void do_mdmx(struct pt_regs *regs)
|
||||
enum ctx_state prev_state;
|
||||
|
||||
prev_state = exception_enter();
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
|
||||
@@ -1592,7 +1592,7 @@ asmlinkage void do_mt(struct pt_regs *regs)
|
||||
}
|
||||
die_if_kernel("MIPS MT Thread exception in kernel", regs);
|
||||
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
}
|
||||
|
||||
|
||||
@@ -1601,7 +1601,7 @@ asmlinkage void do_dsp(struct pt_regs *regs)
|
||||
if (cpu_has_dsp)
|
||||
panic("Unexpected DSP exception");
|
||||
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
}
|
||||
|
||||
asmlinkage void do_reserved(struct pt_regs *regs)
|
||||
|
@@ -1365,20 +1365,20 @@ fault:
|
||||
return;
|
||||
|
||||
die_if_kernel("Unhandled kernel unaligned access", regs);
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
|
||||
return;
|
||||
|
||||
sigbus:
|
||||
die_if_kernel("Unhandled kernel unaligned access", regs);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
|
||||
return;
|
||||
|
||||
sigill:
|
||||
die_if_kernel
|
||||
("Unhandled kernel unaligned access or invalid instruction", regs);
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
}
|
||||
|
||||
/* Recode table from 16-bit register notation to 32-bit GPR. */
|
||||
@@ -1991,20 +1991,20 @@ fault:
|
||||
return;
|
||||
|
||||
die_if_kernel("Unhandled kernel unaligned access", regs);
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
|
||||
return;
|
||||
|
||||
sigbus:
|
||||
die_if_kernel("Unhandled kernel unaligned access", regs);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
|
||||
return;
|
||||
|
||||
sigill:
|
||||
die_if_kernel
|
||||
("Unhandled kernel unaligned access or invalid instruction", regs);
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
}
|
||||
|
||||
static void emulate_load_store_MIPS16e(struct pt_regs *regs, void __user * addr)
|
||||
@@ -2271,20 +2271,20 @@ fault:
|
||||
return;
|
||||
|
||||
die_if_kernel("Unhandled kernel unaligned access", regs);
|
||||
force_sig(SIGSEGV, current);
|
||||
force_sig(SIGSEGV);
|
||||
|
||||
return;
|
||||
|
||||
sigbus:
|
||||
die_if_kernel("Unhandled kernel unaligned access", regs);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
|
||||
return;
|
||||
|
||||
sigill:
|
||||
die_if_kernel
|
||||
("Unhandled kernel unaligned access or invalid instruction", regs);
|
||||
force_sig(SIGILL, current);
|
||||
force_sig(SIGILL);
|
||||
}
|
||||
|
||||
asmlinkage void do_ade(struct pt_regs *regs)
|
||||
@@ -2364,7 +2364,7 @@ asmlinkage void do_ade(struct pt_regs *regs)
|
||||
|
||||
sigbus:
|
||||
die_if_kernel("Kernel unaligned instruction access", regs);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
|
||||
/*
|
||||
* XXX On return from the signal handler we should advance the epc
|
||||
|
@@ -98,7 +98,7 @@ void ip22_be_interrupt(int irq)
|
||||
field, regs->cp0_epc, field, regs->regs[31]);
|
||||
/* Assume it would be too dangerous to continue ... */
|
||||
die_if_kernel("Oops", regs);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
}
|
||||
|
||||
static int ip22_be_handler(struct pt_regs *regs, int is_fixup)
|
||||
|
@@ -462,7 +462,7 @@ void ip22_be_interrupt(int irq)
|
||||
if (ip28_be_interrupt(regs) != MIPS_BE_DISCARD) {
|
||||
/* Assume it would be too dangerous to continue ... */
|
||||
die_if_kernel("Oops", regs);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
} else if (debug_be_interrupt)
|
||||
show_regs(regs);
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ int ip27_be_handler(struct pt_regs *regs, int is_fixup)
|
||||
show_regs(regs);
|
||||
dump_tlb_all();
|
||||
while(1);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
}
|
||||
|
||||
void __init ip27_be_init(void)
|
||||
|
@@ -29,7 +29,7 @@ static int ip32_be_handler(struct pt_regs *regs, int is_fixup)
|
||||
show_regs(regs);
|
||||
dump_tlb_all();
|
||||
while(1);
|
||||
force_sig(SIGBUS, current);
|
||||
force_sig(SIGBUS);
|
||||
}
|
||||
|
||||
void __init ip32_be_init(void)
|
||||
|
Reference in New Issue
Block a user