函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\kprobes\opt.c Create Date:2022-07-27 09:38:26
Last Modify:2022-05-22 07:44:06 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__recover_optprobed_insn

函数原型:unsigned long __recover_optprobed_insn(kprobe_opcode_t *buf, unsigned long addr)

返回类型:unsigned long

参数:

类型参数名称
kprobe_opcode_t *buf
unsigned longaddr
41 i小于RELATIVEJUMP_SIZE循环
42  kp等于Get the kprobe at this addr (if any) - called with preemption disabled
47  如果链表为空则转到:found
52  返回:addr
53  found :
59  如果probe_kernel_read(): safely attempt to read from a location*@dst: pointer to the buffer that shall take the data*@src: address to read from*@size: size of the data chunk* Safely read from address @src to the buffer at @dst. If a kernel fault则返回:0UL
63  如果addr恒等于 location of the probe point
64  buf[0]等于 Saved opcode (which has been replaced with breakpoint)
65  memcpy(buf + 1, copied_insn, RELATIVE_ADDR_SIZE)
66  否则
67  offs等于addr location of the probe point 减1
68  memcpy(buf, copy of the original instructions + offs, RELATIVE_ADDR_SIZE - offs)
71  返回:buf
调用者
名称描述
recover_probed_instructionRecover the probed instruction at addr for further analysis.* Caller must lock kprobes by kprobe_mutex, or disable preemption* for preventing to release referencing kprobes.* Returns zero if the instruction can not get recovered (or access failed).