[patch] i386: another possible singlestep fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When entering kernel via int80, TIF_SINGLESTEP is not set
when TF has been set in eflags by the user.  This patch
does that.

To make things symmetrical, something further should be done.
Either (a) add to this patch so it clears TF after setting
TIF_SINGLESTEP, or (b) change the sysenter path so it sets
TF in regs.eflags when it finds TIF_SINGLESTEP was set by
do_debug() during kernel entry.

Signed-off-by: Chuck Ebbert <[email protected]>

--- 2.6.16-rc3.orig/arch/i386/kernel/entry.S
+++ 2.6.16-rc3/arch/i386/kernel/entry.S
@@ -226,6 +226,10 @@ ENTRY(system_call)
 	pushl %eax			# save orig_eax
 	SAVE_ALL
 	GET_THREAD_INFO(%ebp)
+	testl $TF_MASK,EFLAGS(%esp)
+	jz no_singlestep
+	orl $_TIF_SINGLESTEP,TI_flags(%ebp)
+no_singlestep:
 					# system call tracing in operation / emulation
 	/* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
 	testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux