函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\kprobes\core.c Create Date:2022-07-27 09:37:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:setup_singlestep

函数原型:static void setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb, int reenter)

返回类型:void

参数:

类型参数名称
struct kprobe *p
struct pt_regs *regs
struct kprobe_ctlblk *kcb
intreenter
584  如果setup_detour_execution(p, regs, reenter)则返回
588  如果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).且非 Called after addr is executed, unless...
590  如果非reenterreset_current_kprobe()
597  ip等于copy of the original instruction
598  返回
601  如果reenter
602  save_previous_kprobe(kcb)
603  set_current_kprobe(p, regs, kcb)
604  kprobe_status等于KPROBE_REENTER
605  否则kprobe_status等于KPROBE_HIT_SS
608  clear_btf()
609  flags或等于X86_EFLAGS_TF
610  flags与等于X86_EFLAGS_IF的反
612  如果 Saved opcode (which has been replaced with breakpoint) 恒等于BREAKPOINT_INSTRUCTIONip等于 location of the probe point
614  否则ip等于copy of the original instruction
调用者
名称描述
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.