p = current_kprobe; 
p = __get_cpu_var(current_kprobe); 
static int __kprobes kprobe_handler(struct pt_regs *regs){	struct kprobe *p;	int ret = 0;	kprobe_opcode_t *addr = NULL;	unsigned long *lp;	/* 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 *) (get_desc_base(lp) + regs->eip -						sizeof(kprobe_opcode_t));	} else {		addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));	}	/* Check we're not actually recursing */	if (kprobe_running()) {		/* We *are* holding lock here, so this is safe.		   Disarm the probe we just hit, and ignore it. */		p = get_kprobe(addr);		if (p) {			if (kprobe_status == KPROBE_HIT_SS &&				*p->ainsn.insn == BREAKPOINT_INSTRUCTION) {				regs->eflags &= ~TF_MASK;				regs->eflags |= kprobe_saved_eflags;				unlock_kprobes();				goto no_kprobe;			}			/* We have reentered the kprobe_handler(), since			 * another probe was hit while within the handler.			 * We here save the original kprobes variables and			 * just single step on the instruction of the new probe			 * without calling any user handlers.			 */			save_previous_kprobe();			set_current_kprobe(p, regs);			p->nmissed++;			prepare_singlestep(p, regs);			kprobe_status = KPROBE_REENTER;			return 1;		} else {			p = current_kprobe;			if (p->break_handler && p->break_handler(p, regs)) {				goto ss_probe;			}		}		/* If it's not ours, can't be delete race, (we hold lock). */		goto no_kprobe;	}	lock_kprobes();	p = get_kprobe(addr);	if (!p) {		unlock_kprobes();		if (regs->eflags & VM_MASK) {			/* We are in virtual-8086 mode. Return 0 */			goto no_kprobe;		}		if (*addr != BREAKPOINT_INSTRUCTION) {			/*			 * The breakpoint instruction was removed right			 * after we hit it.  Another cpu has removed			 * either a probepoint or a debugger breakpoint			 * at this address.  In either case, no further			 * handling of this interrupt is appropriate.			 * Back up over the (now missing) int3 and run			 * the original instruction.			 */			regs->eip -= sizeof(kprobe_opcode_t);			ret = 1;		}		/* Not one of ours: let kernel handle it */		goto no_kprobe;	}	/*	 * This preempt_disable() matches the preempt_enable_no_resched()	 * in post_kprobe_handler()	 */	preempt_disable();	kprobe_status = KPROBE_HIT_ACTIVE;	set_current_kprobe(p, regs);	if (p->pre_handler && p->pre_handler(p, regs))		/* handler has already set things up, so skip ss setup */		return 1;ss_probe:	prepare_singlestep(p, regs);	kprobe_status = KPROBE_HIT_SS;	return 1;no_kprobe:	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/9a0e3a86837ac7542e601c18346102c9d9e65fa5/kprobes.c/buggy/arch/i386/kernel/kprobes.c