Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\kprobes\core.c Create Date:2022-07-28 08:38:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:setup_singlestep

Proto:static void setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb, int reenter)

Type:void

Parameter:

TypeParameterName
struct kprobe *p
struct pt_regs *regs
struct kprobe_ctlblk *kcb
intreenter
584  If setup_detour_execution(p, regs, reenter) Then Return
588  If stable = false: This instruction type is not boostable.* boostable = true: This instruction has been boosted: we have* added a relative jump after the instruction copy in insn,* so no single-step and fixup are needed (unless there's* a post_handler). && Not Called after addr is executed, unless... Then
590  If Not reenter Then reset_current_kprobe()
597  ip = copy of the original instruction
598  Return
601  If reenter Then
602  save_previous_kprobe(kcb)
603  set_current_kprobe(p, regs, kcb)
604  kprobe_status = KPROBE_REENTER
605  Else kprobe_status = KPROBE_HIT_SS
608  clear_btf()
609  flags |= X86_EFLAGS_TF
610  flags &= ~X86_EFLAGS_IF
612  If Saved opcode (which has been replaced with breakpoint) == BREAKPOINT_INSTRUCTION Then ip = location of the probe point
614  Else ip = copy of the original instruction
Caller
NameDescribe
reenter_kprobeWe have reentered the kprobe_handler(), since another probe was hit while* within the handler. We save the original kprobes variables and just single* step on the instruction of the new probe without calling any user handlers.
kprobe_int3_handlerInterrupts are disabled on entry as trap3 is an interrupt gate and they* remain disabled throughout this function.