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