kretprobe_find_ret_addr(9)
kretprobe_find_ret_addr(9) π
okay so bestie, this is the Kernel API Manual page for kretprobe_find_ret_addr, and it's literally about finding the correct return address that a kretprobe modified. yes, that's the whole vibe. π
π NAME π
kretprobe_find_ret_addr β Find correct return address modified by kretprobe
β¨ SYNOPSIS β¨
unsigned long kretprobe_find_ret_addr (struct task_struct *tsk , void
*fp , struct llist_node **cur );
π«Ά ARGUMENTS π«Ά
tskβ Target task. the main character whose return address we're checking. πfpβ A frame pointer. it's giving helpful-hint energy. β¨curβ a storage of the loop cursorllist_nodepointer for next call. lowkey the loop's little bookmark. π
π₯ DESCRIPTION π₯
So it finds the correct return address modified by a kretprobe on tsk, in unsigned long type. If it finds the return address, it returns that address value; otherwise it returns 0. that's it. no cap. π
Now the constraints, because they matter:
β οΈ thetskmust be'current'or a task which is not running. andfpis a hint to get the currect return address β which is compared with thekretprobe_instance::fpfield. (yes, the original says currect, keeping it 100% intact, iykyk π«Ά)
The cur is a loop cursor for searching the kretprobe return addresses on the tsk. and this bit is important:
π¨ the'*cur'should beNULLat the first call, but'cur'itself must NOT NULL. like, not optional. do not come in here with a NULLcur. π ββοΈ
π SEE ALSO π
- Kernel file
./kernel/kprobes.c __get_insn_slot(9)kprobe_on_func_entry(9)
go read those if you're nosy π
okay that's the page, bestie π«Ά kretprobe_find_ret_addr(9), source/version ./kernel, dated October 2026. kisses, and happy probe-ing πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms