Commit 2e1661d2 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

signal: Remove the task parameter from force_sig_fault



As synchronous exceptions really only make sense against the current
task (otherwise how are you synchronous) remove the task parameter
from from force_sig_fault to make it explicit that is what is going
on.

The two known exceptions that deliver a synchronous exception to a
stopped ptraced task have already been changed to
force_sig_fault_to_task.

The callers have been changed with the following emacs regular expression
(with obvious variations on the architectures that take more arguments)
to avoid typos:

force_sig_fault[(]\([^,]+\)[,]\([^,]+\)[,]\([^,]+\)[,]\W+current[)]
->
force_sig_fault(\1,\2,\3)

Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 91ca180d
......@@ -402,7 +402,7 @@ do_entDbg(struct pt_regs *regs)
{
die_if_kernel("Instruction fault", regs, 0, NULL);
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0, current);
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0);
}
......
......@@ -221,13 +221,13 @@ retry:
up_read(&mm->mmap_sem);
/* Send a sigbus, regardless of whether we were in kernel
or user mode. */
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address, 0, current);
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address, 0);
if (!user_mode(regs))
goto no_context;
return;
do_sigsegv:
force_sig_fault(SIGSEGV, si_code, (void __user *) address, 0, current);
force_sig_fault(SIGSEGV, si_code, (void __user *) address, 0);
return;
#ifdef CONFIG_ALPHA_LARGE_VMALLOC
......
......@@ -50,7 +50,7 @@ unhandled_exception(const char *str, struct pt_regs *regs,
tsk->thread.fault_address = (__force unsigned int)addr;
force_sig_fault(signo, si_code, addr, current);
force_sig_fault(signo, si_code, addr);
} else {
/* If not due to copy_(to|from)_user, we are doomed */
......
......@@ -202,7 +202,7 @@ bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
if (user_mode(regs)) {
tsk->thread.fault_address = address;
force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
force_sig_fault(SIGSEGV, si_code, (void __user *)address);
return;
}
......@@ -237,5 +237,5 @@ do_sigbus:
goto no_context;
tsk->thread.fault_address = address;
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address);
}
......@@ -204,7 +204,7 @@ void ptrace_disable(struct task_struct *child)
void ptrace_break(struct pt_regs *regs)
{
force_sig_fault(SIGTRAP, TRAP_BRKPT,
(void __user *)instruction_pointer(regs), current);
(void __user *)instruction_pointer(regs));
}
static int break_trap(struct pt_regs *regs, unsigned int instr)
......
......@@ -372,7 +372,7 @@ void arm_notify_die(const char *str, struct pt_regs *regs,
current->thread.error_code = err;
current->thread.trap_no = trap;
force_sig_fault(signo, si_code, addr, current);
force_sig_fault(signo, si_code, addr);
} else {
die(str, regs, err);
}
......
......@@ -948,7 +948,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
goto fixup;
if (ai_usermode & UM_SIGNAL) {
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr, current);
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr);
} else {
/*
* We're about to disable the alignment trap and return to
......
......@@ -184,7 +184,7 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig,
tsk->thread.address = addr;
tsk->thread.error_code = fsr;
tsk->thread.trap_no = 14;
force_sig_fault(sig, code, (void __user *)addr, current);
force_sig_fault(sig, code, (void __user *)addr);
}
void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
......
......@@ -259,7 +259,7 @@ void arm64_force_sig_fault(int signo, int code, void __user *addr,
if (signo == SIGKILL)
force_sig(SIGKILL);
else
force_sig_fault(signo, code, addr, current);
force_sig_fault(signo, code, addr);
}
void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,
......
......@@ -253,7 +253,7 @@ static void do_trap(struct exception_info *except_info, struct pt_regs *regs)
die_if_kernel(except_info->kernel_str, regs, addr);
force_sig_fault(except_info->signo, except_info->code,
(void __user *)addr, current);
(void __user *)addr);
}
/*
......
......@@ -283,7 +283,7 @@ bad_area:
do_exit(SIGKILL);
}
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr, current);
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr);
}
static struct ctl_table alignment_tbl[4] = {
......
......@@ -124,7 +124,7 @@ void fpu_fpe(struct pt_regs *regs)
code = FPE_FLTRES;
}
force_sig_fault(sig, code, (void __user *)regs->pc, current);
force_sig_fault(sig, code, (void __user *)regs->pc);
}
#define FMFVR_FPU_REGS(vrx, vry) \
......
......@@ -106,7 +106,7 @@ void buserr(struct pt_regs *regs)
pr_err("User mode Bus Error\n");
show_regs(regs);
force_sig_fault(SIGSEGV, 0, (void __user *)regs->pc, current);
force_sig_fault(SIGSEGV, 0, (void __user *)regs->pc);
}
#define USR_BKPT 0x1464
......
......@@ -179,7 +179,7 @@ bad_area:
bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
if (user_mode(regs)) {
force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
force_sig_fault(SIGSEGV, si_code, (void __user *)address);
return;
}
......@@ -212,5 +212,5 @@ do_sigbus:
if (!user_mode(regs))
goto no_context;
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address);
}
......@@ -420,7 +420,7 @@ void do_trap0(struct pt_regs *regs)
* may want to use a different trap0 flavor.
*/
force_sig_fault(SIGTRAP, TRAP_BRKPT,
(void __user *) pt_elr(regs), current);
(void __user *) pt_elr(regs));
} else {
#ifdef CONFIG_KGDB
kgdb_handle_exception(pt_cause(regs), SIGTRAP,
......
......@@ -148,14 +148,14 @@ good_area:
si_signo = SIGSEGV;
si_code = SEGV_ACCERR;
}
force_sig_fault(si_signo, si_code, (void __user *)address, current);
force_sig_fault(si_signo, si_code, (void __user *)address);
return;
bad_area:
up_read(&mm->mmap_sem);
if (user_mode(regs)) {
force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
force_sig_fault(SIGSEGV, si_code, (void __user *)address);
return;
}
/* Kernel-mode fault falls through */
......
......@@ -197,21 +197,21 @@ ia64_emulate_brl (struct pt_regs *regs, unsigned long ar_ec)
*/
printk(KERN_DEBUG "Woah! Unimplemented Instruction Address Trap!\n");
force_sig_fault(SIGILL, ILL_BADIADDR, (void __user *)NULL,
0, 0, 0, current);
0, 0, 0);
} else if (ia64_psr(regs)->tb) {
/*
* Branch Tracing is enabled.
* Force a taken branch signal.
*/
force_sig_fault(SIGTRAP, TRAP_BRANCH, (void __user *)NULL,
0, 0, 0, current);
0, 0, 0);
} else if (ia64_psr(regs)->ss) {
/*
* Single Step is enabled.
* Force a trace signal.
*/
force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)NULL,
0, 0, 0, current);
0, 0, 0);
}
return rv;
}
......@@ -176,7 +176,7 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
}
force_sig_fault(sig, code,
(void __user *) (regs->cr_iip + ia64_psr(regs)->ri),
break_num, 0 /* clear __ISR_VALID */, 0, current);
break_num, 0 /* clear __ISR_VALID */, 0);
}
/*
......@@ -353,7 +353,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
}
force_sig_fault(SIGFPE, si_code,
(void __user *) (regs->cr_iip + ia64_psr(regs)->ri),
0, __ISR_VALID, isr, current);
0, __ISR_VALID, isr);
}
} else {
if (exception == -1) {
......@@ -373,7 +373,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
}
force_sig_fault(SIGFPE, si_code,
(void __user *) (regs->cr_iip + ia64_psr(regs)->ri),
0, __ISR_VALID, isr, current);
0, __ISR_VALID, isr);
}
}
return 0;
......@@ -408,7 +408,7 @@ ia64_illegal_op_fault (unsigned long ec, long arg1, long arg2, long arg3,
force_sig_fault(SIGILL, ILL_ILLOPC,
(void __user *) (regs.cr_iip + ia64_psr(&regs)->ri),
0, 0, 0, current);
0, 0, 0);
return rv;
}
......@@ -483,7 +483,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
+ ia64_psr(&regs)->ri);
}
force_sig_fault(sig, code, addr,
vector, __ISR_VALID, isr, current);
vector, __ISR_VALID, isr);
return;
} else if (ia64_done_with_exception(&regs))
return;
......@@ -493,7 +493,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
case 31: /* Unsupported Data Reference */
if (user_mode(&regs)) {
force_sig_fault(SIGILL, ILL_ILLOPN, (void __user *) iip,
vector, __ISR_VALID, isr, current);
vector, __ISR_VALID, isr);
return;
}
sprintf(buf, "Unsupported data reference");
......@@ -542,7 +542,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
== NOTIFY_STOP)
return;
force_sig_fault(SIGTRAP, si_code, (void __user *) ifa,
0, __ISR_VALID, isr, current);
0, __ISR_VALID, isr);
return;
case 32: /* fp fault */
......@@ -550,7 +550,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
result = handle_fpu_swa((vector == 32) ? 1 : 0, &regs, isr);
if ((result < 0) || (current->thread.flags & IA64_THREAD_FPEMU_SIGFPE)) {
force_sig_fault(SIGFPE, FPE_FLTINV, (void __user *) iip,
0, __ISR_VALID, isr, current);
0, __ISR_VALID, isr);
}
return;
......@@ -578,7 +578,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
if (user_mode(&regs)) {
force_sig_fault(SIGILL, ILL_BADIADDR,
(void __user *) iip,
0, 0, 0, current);
0, 0, 0);
return;
}
sprintf(buf, "Unimplemented Instruction Address fault");
......
......@@ -1537,6 +1537,6 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
}
force_sigbus:
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) ifa,
0, 0, 0, current);
0, 0, 0);
goto done;
}
......@@ -249,7 +249,7 @@ retry:
}
if (user_mode(regs)) {
force_sig_fault(signal, code, (void __user *) address,
0, __ISR_VALID, isr, current);
0, __ISR_VALID, isr);
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment