Re: [patch] kprobes: dont steal interrupts from vm86

From: Andi Kleen
Date: Fri Jan 07 2005 - 08:01:38 EST


Prasanna S Panchamukhi <prasanna@xxxxxxxxxx> writes:


> + /* Check if the application is using LDT entry for its code segment and
> + * calculate the address by reading the base address from the LDT entry.
> + */
> + if ((regs->xcs & 4) && (current->mm)) {
> + lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
> + + (char *) current->mm->context.ldt);
> + addr = (kprobe_opcode_t *) ((((*lp) >> 16 & 0x0000ffff)
> + | (*(lp +1) & 0xff000000)
> + | ((*(lp +1) << 16) & 0x00ff0000))
> + + regs->eip - sizeof(kprobe_opcode_t));
> + } else {
> + addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
> + }

With that patch we would have LDT reading code three times in the kernel
now (ptrace, prefetch workaround and now this). How about you factor
this out into a common helper function? This stuff is tricky enough
that there are likely bugs in there anyways and it would be best
to only fix them at one place then.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/