kretprobe_find_ret_addr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 cursor llist_node pointer 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:

⚠️ the tsk must be 'current' or a task which is not running. and fp is a hint to get the currect return address β€” which is compared with the kretprobe_instance::fp field. (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 be NULL at the first call, but 'cur' itself must NOT NULL. like, not optional. do not come in here with a NULL cur. πŸ™…β€β™€οΈ

🌈 SEE ALSO 🌈

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