[PATCH 0/2] update ptrace_disable() + PTRACE_SYSEMU/TIF_SYSCALL_EMU fix

2011-07-03 Thread Oleg Nesterov
On 07/01, Oleg Nesterov wrote:

   - Perhaps PTRACE_SYSEMU/TIF_SYSCALL_EMU logic was broken,
 I need to recheck.

Yes, it was. Fixed by 2/2.

ptrace: shift user_*_step() from ptrace_resume() to ptrace_stop()
forgot to change ptrace_disable(), see 1/2.

Oleg.



[PATCH 2/2] ptrace_report_syscall: check TIF_SYSCALL_EMU

2011-07-03 Thread Oleg Nesterov
4d16a64 introduce PT_SYSCALL_TRACE flag breaks PTRACE_SYSEMU
which doesn't set PT_SYSCALL_TRACE.

Change ptrace_report_syscall() to check TIF_SYSCALL_EMU as well.
This can't conflict with utrace, this flag can only be set by
ptrace.

Signed-off-by: Oleg Nesterov o...@redhat.com
---
 include/linux/tracehook.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 5612d2d..ac833de 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -76,7 +76,7 @@ static inline void ptrace_report_syscall(struct pt_regs *regs)
 {
int ptrace = task_ptrace(current);
 
-   if (!(ptrace  PT_SYSCALL_TRACE))
+   if (!(ptrace  PT_SYSCALL_TRACE)  !test_thread_flag(TIF_SYSCALL_EMU))
return;
 
ptrace_notify(SIGTRAP | ((ptrace  PT_TRACESYSGOOD) ? 0x80 : 0));
-- 
1.5.5.1