Index: linux-2.6.18.8/arch/i386/kernel/signal.c =================================================================== --- linux-2.6.18.8.orig/arch/i386/kernel/signal.c +++ linux-2.6.18.8/arch/i386/kernel/signal.c @@ -391,7 +391,7 @@ static int setup_frame(int sig, struct k * The tracer may want to single-step inside the * handler too. */ - regs->eflags &= ~TF_MASK; + regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF); if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); @@ -485,7 +485,7 @@ static int setup_rt_frame(int sig, struc * The tracer may want to single-step inside the * handler too. */ - regs->eflags &= ~TF_MASK; + regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF); if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); Index: linux-2.6.18.8/arch/x86_64/ia32/ia32_signal.c =================================================================== --- linux-2.6.18.8.orig/arch/x86_64/ia32/ia32_signal.c +++ linux-2.6.18.8/arch/x86_64/ia32/ia32_signal.c @@ -493,7 +493,7 @@ int ia32_setup_frame(int sig, struct k_s regs->ss = __USER32_DS; set_fs(USER_DS); - regs->eflags &= ~TF_MASK; + regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF); if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); @@ -589,7 +589,7 @@ int ia32_setup_rt_frame(int sig, struct regs->ss = __USER32_DS; set_fs(USER_DS); - regs->eflags &= ~TF_MASK; + regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF); if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); Index: linux-2.6.18.8/arch/x86_64/kernel/signal.c =================================================================== --- linux-2.6.18.8.orig/arch/x86_64/kernel/signal.c +++ linux-2.6.18.8/arch/x86_64/kernel/signal.c @@ -302,7 +302,7 @@ static int setup_rt_frame(int sig, struc see include/asm-x86_64/uaccess.h for details. */ set_fs(USER_DS); - regs->eflags &= ~TF_MASK; + regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF); if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); #ifdef DEBUG_SIG