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