函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Called from kretprobe_trampoline

函数原型:__used __visible void *trampoline_handler(struct pt_regs *regs)

返回类型:void

参数:

类型参数名称
struct pt_regs *regs
763  struct kretprobe_instance * ri = NULL
766  orig_ret_address等于0
767  unsigned long trampoline_address = (unsigned long) & kretprobe_trampoline
768  kprobe_opcode_t * correct_ret_addr = NULL
770  bool skipped = false
772  禁止抢占()
779  kcb等于get_kprobe_ctlblk()
780  __this_cpu_write(current_kprobe, & kretprobe_kprobe)
781  kprobe_status等于kprobe_status settings
783  INIT_HLIST_HEAD( & empty_rp)
784  kretprobe_hash_lock(当前进程, & head, & flags)
786  cs等于Segment selector values corresponding to the above entries:
788  cs或等于get_kernel_rpl()
789  gs等于0
792  frame_pointer等于sp
793  ip等于trampoline_address
794  orig_ax等于0UL的反
810  如果task不等于当前进程则继续下一循环
821  如果fp不等于frame_pointer
822  如果非skipped打印警告信息("kretprobe is stacked incorrectly. Trying to fixup.\n")
824  skipped = true
825  继续下一循环
828  orig_ret_address等于ret_addr
829  如果skipped打印警告信息("%ps must be blacklisted because of incorrect kretprobe order\n", addr)
833  如果orig_ret_address不等于trampoline_address退出
842  kretprobe_assert(ri, orig_ret_address, trampoline_address)
844  correct_ret_addr等于ret_addr
846  如果task不等于当前进程则继续下一循环
849  如果fp不等于frame_pointer则继续下一循环
852  orig_ret_address等于ret_addr
853  如果rphandler
854  __this_cpu_write(current_kprobe, & kp)
855  ret_addr等于correct_ret_addr
856  handler(ri, regs)
857  __this_cpu_write(current_kprobe, & kretprobe_kprobe)
860  recycle_rp_inst(ri, & empty_rp)
862  如果orig_ret_address不等于trampoline_address退出
871  kretprobe_hash_unlock(当前进程, & flags)
873  __this_cpu_write(current_kprobe, NULL)
874  禁用抢占和中断()
877  hlist_del( & hlist)
878  释放内存
880  返回:orig_ret_address