Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / arch / i386 / kernel / ptrace.c
index d3db03f..775f50e 100644 (file)
@@ -185,17 +185,17 @@ static unsigned long convert_eip_to_linear(struct task_struct *child, struct pt_
        return addr;
 }
 
-static inline int is_at_popf(struct task_struct *child, struct pt_regs *regs)
+static inline int is_setting_trap_flag(struct task_struct *child, struct pt_regs *regs)
 {
        int i, copied;
-       unsigned char opcode[16];
+       unsigned char opcode[15];
        unsigned long addr = convert_eip_to_linear(child, regs);
 
        copied = access_process_vm(child, addr, opcode, sizeof(opcode), 0);
        for (i = 0; i < copied; i++) {
                switch (opcode[i]) {
-               /* popf */
-               case 0x9d:
+               /* popf and iret */
+               case 0x9d: case 0xcf:
                        return 1;
                /* opcode and address size prefixes */
                case 0x66: case 0x67:
@@ -247,7 +247,7 @@ static void set_singlestep(struct task_struct *child)
         * don't mark it as being "us" that set it, so that we
         * won't clear it by hand later.
         */
-       if (is_at_popf(child, regs))
+       if (is_setting_trap_flag(child, regs))
                return;
        
        child->ptrace |= PT_DTRACE;