]> git.hungrycats.org Git - linux/commitdiff
Make sure no user level thing can trigger debug breakpoints
authorLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 7 Mar 2002 08:36:03 +0000 (00:36 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 7 Mar 2002 08:36:03 +0000 (00:36 -0800)
inside the kernel on x86 (TF is writable)

arch/i386/kernel/traps.c

index 4a40438bdf2cd5a8bdbbee976fa1dc38b7d9add6..0b237ad2895c593f765cacaab784a16ad459e815 100644 (file)
@@ -557,6 +557,8 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code)
                 * allowing programs to debug themselves without the ptrace()
                 * interface.
                 */
+               if ((regs->xcs & 3) == 0)
+                       goto clear_TF;
                if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
                        goto clear_TF;
        }