diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2019-02-05 19:25:11 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2019-05-29 10:30:48 -0400 |
commit | 28d42ea14e489047caeaa89496a3ad7e0ae6a49f (patch) | |
tree | 895bd73d7e510332abd37978ffba288a0ebd202d | |
parent | f8eac9011b6be56acfb5d1d0dfd5ee30082a12ee (diff) |
signal/x86: Remove task parameter from send_sigtrap
The send_sigtrap function is always called with task == current. Make
that explicit by removing the task parameter.
This also makes it clear that the x86 send_sigtrap passes current
into force_sig_fault.
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r-- | arch/x86/include/asm/ptrace.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index 8a7fc0cca2d1..28779bf7951f 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h | |||
@@ -102,8 +102,7 @@ extern unsigned long profile_pc(struct pt_regs *regs); | |||
102 | 102 | ||
103 | extern unsigned long | 103 | extern unsigned long |
104 | convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); | 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, | 105 | extern void send_sigtrap(struct pt_regs *regs, int error_code, int si_code); |
106 | int error_code, int si_code); | ||
107 | 106 | ||
108 | 107 | ||
109 | static inline unsigned long regs_return_value(struct pt_regs *regs) | 108 | static inline unsigned long regs_return_value(struct pt_regs *regs) |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 4b8ee05dd6ad..00148141f138 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -1360,9 +1360,10 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task) | |||
1360 | #endif | 1360 | #endif |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | 1363 | void send_sigtrap(struct pt_regs *regs, int error_code, int si_code) |
1364 | int error_code, int si_code) | ||
1365 | { | 1364 | { |
1365 | struct task_struct *tsk = current; | ||
1366 | |||
1366 | tsk->thread.trap_nr = X86_TRAP_DB; | 1367 | tsk->thread.trap_nr = X86_TRAP_DB; |
1367 | tsk->thread.error_code = error_code; | 1368 | tsk->thread.error_code = error_code; |
1368 | 1369 | ||
@@ -1373,5 +1374,5 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | |||
1373 | 1374 | ||
1374 | void user_single_step_report(struct pt_regs *regs) | 1375 | void user_single_step_report(struct pt_regs *regs) |
1375 | { | 1376 | { |
1376 | send_sigtrap(current, regs, 0, TRAP_BRKPT); | 1377 | send_sigtrap(regs, 0, TRAP_BRKPT); |
1377 | } | 1378 | } |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index e54f0cad4b2e..30a9b843ef04 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -805,7 +805,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code) | |||
805 | } | 805 | } |
806 | si_code = get_si_code(tsk->thread.debugreg6); | 806 | si_code = get_si_code(tsk->thread.debugreg6); |
807 | if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) | 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 | cond_local_irq_disable(regs); | 809 | cond_local_irq_disable(regs); |
810 | debug_stack_usage_dec(); | 810 | debug_stack_usage_dec(); |
811 | 811 | ||