Skip to content

Commit 2e1661d

Browse files
committed
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: "Eric W. Biederman" <ebiederm@xmission.com>
1 parent 91ca180 commit 2e1661d

67 files changed

Lines changed: 137 additions & 151 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/alpha/kernel/traps.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ do_entDbg(struct pt_regs *regs)
402402
{
403403
die_if_kernel("Instruction fault", regs, 0, NULL);
404404

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);
406406
}
407407

408408

‎arch/alpha/mm/fault.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
221221
up_read(&mm->mmap_sem);
222222
/* Send a sigbus, regardless of whether we were in kernel
223223
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);
225225
if (!user_mode(regs))
226226
goto no_context;
227227
return;
228228

229229
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);
231231
return;
232232

233233
#ifdef CONFIG_ALPHA_LARGE_VMALLOC

‎arch/arc/kernel/traps.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ unhandled_exception(const char *str, struct pt_regs *regs,
5050

5151
tsk->thread.fault_address = (__force unsigned int)addr;
5252

53-
force_sig_fault(signo, si_code, addr, current);
53+
force_sig_fault(signo, si_code, addr);
5454

5555
} else {
5656
/* If not due to copy_(to|from)_user, we are doomed */

‎arch/arc/mm/fault.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
202202
/* User mode accesses just cause a SIGSEGV */
203203
if (user_mode(regs)) {
204204
tsk->thread.fault_address = address;
205-
force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
205+
force_sig_fault(SIGSEGV, si_code, (void __user *)address);
206206
return;
207207
}
208208

@@ -237,5 +237,5 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
237237
goto no_context;
238238

239239
tsk->thread.fault_address = address;
240-
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
240+
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address);
241241
}

‎arch/arm/kernel/ptrace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void ptrace_disable(struct task_struct *child)
204204
void ptrace_break(struct pt_regs *regs)
205205
{
206206
force_sig_fault(SIGTRAP, TRAP_BRKPT,
207-
(void __user *)instruction_pointer(regs), current);
207+
(void __user *)instruction_pointer(regs));
208208
}
209209

210210
static int break_trap(struct pt_regs *regs, unsigned int instr)

‎arch/arm/kernel/traps.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ void arm_notify_die(const char *str, struct pt_regs *regs,
372372
current->thread.error_code = err;
373373
current->thread.trap_no = trap;
374374

375-
force_sig_fault(signo, si_code, addr, current);
375+
force_sig_fault(signo, si_code, addr);
376376
} else {
377377
die(str, regs, err);
378378
}

‎arch/arm/mm/alignment.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
948948
goto fixup;
949949

950950
if (ai_usermode & UM_SIGNAL) {
951-
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr, current);
951+
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr);
952952
} else {
953953
/*
954954
* We're about to disable the alignment trap and return to

‎arch/arm/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig,
184184
tsk->thread.address = addr;
185185
tsk->thread.error_code = fsr;
186186
tsk->thread.trap_no = 14;
187-
force_sig_fault(sig, code, (void __user *)addr, current);
187+
force_sig_fault(sig, code, (void __user *)addr);
188188
}
189189

190190
void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)

‎arch/arm64/kernel/traps.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void arm64_force_sig_fault(int signo, int code, void __user *addr,
259259
if (signo == SIGKILL)
260260
force_sig(SIGKILL);
261261
else
262-
force_sig_fault(signo, code, addr, current);
262+
force_sig_fault(signo, code, addr);
263263
}
264264

265265
void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,

‎arch/c6x/kernel/traps.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static void do_trap(struct exception_info *except_info, struct pt_regs *regs)
253253
die_if_kernel(except_info->kernel_str, regs, addr);
254254

255255
force_sig_fault(except_info->signo, except_info->code,
256-
(void __user *)addr, current);
256+
(void __user *)addr);
257257
}
258258

259259
/*

0 commit comments

Comments
 (0)