diff options
Diffstat (limited to 'arch/x86')
| -rw-r--r-- | arch/x86/entry/common.c | 17 | ||||
| -rw-r--r-- | arch/x86/kernel/ptrace.c | 3 |
2 files changed, 6 insertions, 14 deletions
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c index 2418804e66b4..536b574b6161 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c | |||
| @@ -72,23 +72,18 @@ static long syscall_trace_enter(struct pt_regs *regs) | |||
| 72 | 72 | ||
| 73 | struct thread_info *ti = current_thread_info(); | 73 | struct thread_info *ti = current_thread_info(); |
| 74 | unsigned long ret = 0; | 74 | unsigned long ret = 0; |
| 75 | bool emulated = false; | ||
| 76 | u32 work; | 75 | u32 work; |
| 77 | 76 | ||
| 78 | if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) | 77 | if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) |
| 79 | BUG_ON(regs != task_pt_regs(current)); | 78 | BUG_ON(regs != task_pt_regs(current)); |
| 80 | 79 | ||
| 81 | work = READ_ONCE(ti->flags) & _TIF_WORK_SYSCALL_ENTRY; | 80 | work = READ_ONCE(ti->flags); |
| 82 | 81 | ||
| 83 | if (unlikely(work & _TIF_SYSCALL_EMU)) | 82 | if (work & (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU)) { |
| 84 | emulated = true; | 83 | ret = tracehook_report_syscall_entry(regs); |
| 85 | 84 | if (ret || (work & _TIF_SYSCALL_EMU)) | |
| 86 | if ((emulated || (work & _TIF_SYSCALL_TRACE)) && | 85 | return -1L; |
| 87 | tracehook_report_syscall_entry(regs)) | 86 | } |
| 88 | return -1L; | ||
| 89 | |||
| 90 | if (emulated) | ||
| 91 | return -1L; | ||
| 92 | 87 | ||
| 93 | #ifdef CONFIG_SECCOMP | 88 | #ifdef CONFIG_SECCOMP |
| 94 | /* | 89 | /* |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index a166c960bc9e..36998e0c3fc4 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
| @@ -747,9 +747,6 @@ static int ioperm_get(struct task_struct *target, | |||
| 747 | void ptrace_disable(struct task_struct *child) | 747 | void ptrace_disable(struct task_struct *child) |
| 748 | { | 748 | { |
| 749 | user_disable_single_step(child); | 749 | user_disable_single_step(child); |
| 750 | #ifdef TIF_SYSCALL_EMU | ||
| 751 | clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); | ||
| 752 | #endif | ||
| 753 | } | 750 | } |
| 754 | 751 | ||
| 755 | #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION | 752 | #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION |
