Unverified Commit a7dc8eb5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!3272 x86/kprobes: Fix the error judgment for debug exceptions

parents bffb3bc9 29bef482
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -900,7 +900,15 @@ int kprobe_debug_handler(struct pt_regs *regs)
	struct kprobe *cur = kprobe_running();
	struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();

	if (!cur)
	if (!cur || !cur->ainsn.insn)
		return 0;

	/* kprobe will change the status from KPROBE_HIT_ACTIVE to
	 * KPROBE_HIT_SS or KPROBE_REENTER before single-step execution, so
	 * if the current status is KPROBE_HIT_ACTIVE, its not a debug
	 * exception triggered by kprobe.
	 */
	if (kcb->kprobe_status == KPROBE_HIT_ACTIVE)
		return 0;

	resume_execution(cur, regs, kcb);