Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7019
b: refs/heads/master
c: ab1c23c
h: refs/heads/master
i:
  7017: 656c7bb
  7015: bace277
v: v3
  • Loading branch information
Bodo Stroesser authored and Linus Torvalds committed Sep 5, 2005
1 parent b7f0fe9 commit 59cf0f6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b38f0064e4e0b9ec626e39f0740b1cf2e295743
refs/heads/master: ab1c23c24471c760c573f4fb0dd78e166ddfd844
23 changes: 20 additions & 3 deletions trunk/arch/i386/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ static void clear_singlestep(struct task_struct *child)
void ptrace_disable(struct task_struct *child)
{
clear_singlestep(child);
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
}

/*
Expand Down Expand Up @@ -693,14 +695,29 @@ __attribute__((regparm(3)))
int do_syscall_trace(struct pt_regs *regs, int entryexit)
{
int is_sysemu = test_thread_flag(TIF_SYSCALL_EMU), ret = 0;
/* With TIF_SYSCALL_EMU set we want to ignore TIF_SINGLESTEP */
/* With TIF_SYSCALL_EMU set we want to ignore TIF_SINGLESTEP for syscall
* interception. */
int is_singlestep = !is_sysemu && test_thread_flag(TIF_SINGLESTEP);

/* do the secure computing check first */
secure_computing(regs->orig_eax);

if (unlikely(current->audit_context) && entryexit)
audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax);
if (unlikely(current->audit_context)) {
if (entryexit)
audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax);
/* Debug traps, when using PTRACE_SINGLESTEP, must be sent only
* on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is
* not used, entry.S will call us only on syscall exit, not
* entry; so when TIF_SYSCALL_AUDIT is used we must avoid
* calling send_sigtrap() on syscall entry.
*
* Note that when PTRACE_SYSEMU_SINGLESTEP is used,
* is_singlestep is false, despite his name, so we will still do
* the correct thing.
*/
else if (is_singlestep)
goto out;
}

if (!(current->ptrace & PT_PTRACED))
goto out;
Expand Down

0 comments on commit 59cf0f6

Please sign in to comment.