index.html :: rss :: github :: telegram :: email

kernel: current task pointer

22 Aug 2024

Current task interacting with kernel via syscall always available via *current that points to task_struct.

e.g get pid of a calling process, and syscall number, hijack the do_syscall_x64 function with:

pr_info("XXX do_syscall_x64: syscall_n=%d called by pid=%d\n", nr, current->pid);

Process name defined as current->comm.