Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\uprobes.c Create Date:2022-07-28 13:46:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:prepare_uretprobe

Proto:static void prepare_uretprobe(struct uprobe *uprobe, struct pt_regs *regs)

Type:void

Parameter:

TypeParameterName
struct uprobe *uprobe
struct pt_regs *regs
1869  If Not get_xol_area - Allocate process's xol_area if necessary.* This area will be used for storing instructions for execution out of line.* Returns the allocated area or NULL. Then Return
1872  utask = Allocate a uprobe_task object for the task if if necessary.* Called when the thread hits a breakpoint.* Returns:* - pointer to new uprobe_task on success* - NULL otherwise
1873  If Not utask Then Return
1876  If depth >= MAX_URETPROBE_DEPTH Then
1877  atelimited messages with local ratelimit_state,* no local ratelimit_state used in the !PRINTK case(formational "uprobe: omit uretprobe due to nestedness limit pid/tgid=%d/%d\n", pid, tgid)
1880  Return
1883  ri = Allocation memory
1884  If Not ri Then Return
1887  trampoline_vaddr = Current area->vaddr notion assume the trampoline address is always* equal area->vaddr.* Returns -1 in case the xol_area is not allocated.
1888  orig_ret_vaddr = arch_uretprobe_hijack_return_addr(trampoline_vaddr, regs)
1889  If orig_ret_vaddr == -1 Then Go to fail
1893  chained = orig_ret_vaddr == trampoline_vaddr
1894  cleanup_return_instances(utask, chained, regs)
1901  If chained Then
1902  If Not return_instances Then
1907  uprobe_warn(current process, "handle tail call")
1908  Go to fail
1910  orig_ret_vaddr = original return address
1913  uprobe = get_uprobe(uprobe)
1914  func = instruction_pointer(regs)
1915  stack pointer = user_stack_pointer(regs)
1916  original return address = orig_ret_vaddr
1917  true, if instance is nested = chained
1919  depth++
1920  keep as stack = return_instances
1921  return_instances = ri
1923  Return
1924  fail :
1925  kfree(ri)
Caller
NameDescribe
handler_chain