Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-07 00:36:03 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-07 00:36:03 -0800
commitc639246f91b07cea5c93ff77c12826597fe8dbab (patch)
tree558b4a06d8753621dc46f25d97e1a7f2e2651007
parentff4184641f9065d53bd2bffc1dfcd40b8ff2736e (diff)
Make sure no user level thing can trigger debug breakpoints
inside the kernel on x86 (TF is writable)
-rw-r--r--arch/i386/kernel/traps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 4a40438bdf2c..0b237ad2895c 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -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;
}