struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 
struct kprobe_ctlblk *kcb;  /* * We don't want to be preempted for the entire * duration of kprobe processing */ preempt_disable(); kcb = get_kprobe_ctlblk(); 
int __kprobes kprobe_handler(struct pt_regs *regs){	struct kprobe *p;	int ret = 0;	kprobe_opcode_t *addr = (kprobe_opcode_t *)(regs->rip - sizeof(kprobe_opcode_t));	struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();	/* Check we're not actually recursing */	if (kprobe_running()) {		p = get_kprobe(addr);		if (p) {			if (kcb->kprobe_status == KPROBE_HIT_SS &&				*p->ainsn.insn == BREAKPOINT_INSTRUCTION) {				regs->eflags &= ~TF_MASK;				regs->eflags |= kcb->kprobe_saved_rflags;				goto no_kprobe;			} else if (kcb->kprobe_status == KPROBE_HIT_SSDONE) {				/* TODO: Provide re-entrancy from				 * post_kprobes_handler() and avoid exception				 * stack corruption while single-stepping on				 * the instruction of the new probe.				 */				arch_disarm_kprobe(p);				regs->rip = (unsigned long)p->addr;				reset_current_kprobe();				ret = 1;			} else {				/* We have reentered the kprobe_handler(), since				 * another probe was hit while within the				 * handler. We here save the original kprobe				 * variables and just single step on instruction				 * of the new probe without calling any user				 * handlers.				 */				save_previous_kprobe(kcb);				set_current_kprobe(p, regs, kcb);				p->nmissed++;				prepare_singlestep(p, regs);				kcb->kprobe_status = KPROBE_REENTER;				return 1;			}		} else {			p = __get_cpu_var(current_kprobe);			if (p->break_handler && p->break_handler(p, regs)) {				goto ss_probe;			}		}		goto no_kprobe;	}	p = get_kprobe(addr);	if (!p) {		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->rip = (unsigned long)addr;			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();	set_current_kprobe(p, regs, kcb);	kcb->kprobe_status = KPROBE_HIT_ACTIVE;	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);	kcb->kprobe_status = KPROBE_HIT_SS;	return 1;no_kprobe:	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/d217d5450f11d8c907c0458d175b0dc999b4d06d/kprobes.c/buggy/arch/x86_64/kernel/kprobes.c