1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
# getpgrp ____________________________________________________
# long sys_getpgrp(void)
@define _SYSCALL_GETPGRP_NAME
%(
name = "getpgrp"
%)
@define _SYSCALL_GETPGRP_ARGSTR
%(
argstr = ""
%)
probe syscall.getpgrp = dw_syscall.getpgrp !, nd_syscall.getpgrp ? {}
probe syscall.getpgrp.return = dw_syscall.getpgrp.return !, nd_syscall.getpgrp.return ? {}
# dw_getpgrp _____________________________________________________
probe dw_syscall.getpgrp = kernel.function("sys_getpgrp").call ?
{
@_SYSCALL_GETPGRP_NAME
@_SYSCALL_GETPGRP_ARGSTR
}
probe dw_syscall.getpgrp.return = kernel.function("sys_getpgrp").return ?
{
@_SYSCALL_GETPGRP_NAME
@SYSC_RETVALSTR($return)
}
# nd_getpgrp _____________________________________________________
probe nd_syscall.getpgrp = nd1_syscall.getpgrp!, nd2_syscall.getpgrp!, tp_syscall.getpgrp
{ }
probe nd1_syscall.getpgrp = kprobe.function("sys_getpgrp") ?
{
@_SYSCALL_GETPGRP_NAME
@_SYSCALL_GETPGRP_ARGSTR
}
/* kernel 4.17+ */
probe nd2_syscall.getpgrp = kprobe.function(@arch_syscall0_prefix "sys_getpgrp") ?
{
@_SYSCALL_GETPGRP_NAME
@_SYSCALL_GETPGRP_ARGSTR
}
/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.getpgrp = kernel.trace("sys_enter") ?
{
@__syscall_compat_gate(@const("__NR_getpgrp"), @const("__NR_compat_getpgrp"))
@_SYSCALL_GETPGRP_NAME
@_SYSCALL_GETPGRP_ARGSTR
}
probe nd_syscall.getpgrp.return = nd1_syscall.getpgrp.return!, nd2_syscall.getpgrp.return!, tp_syscall.getpgrp.return
{ }
probe nd1_syscall.getpgrp.return = kprobe.function("sys_getpgrp").return ?
{
@_SYSCALL_GETPGRP_NAME
@SYSC_RETVALSTR(returnval())
}
/* kernel 4.17+ */
probe nd2_syscall.getpgrp.return = kprobe.function(@arch_syscall0_prefix "sys_getpgrp").return ?
{
@_SYSCALL_GETPGRP_NAME
@SYSC_RETVALSTR(returnval())
}
/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.getpgrp.return = kernel.trace("sys_exit")
{
__set_syscall_pt_regs($regs)
@__syscall_compat_gate(@const("__NR_getpgrp"), @const("__NR_compat_getpgrp"))
@_SYSCALL_GETPGRP_NAME
@SYSC_RETVALSTR($ret)
}
|