From 9e41cddd0885be6632cd9d5ecba9b5d62de6d849 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Fri, 23 Dec 2016 15:07:48 +0100 Subject: [PATCH] PR20333/getgid --- tapset/linux/nd_syscalls.stp | 19 -------------- tapset/linux/sysc_getgid.stp | 51 ++++++++++++++++++++++++++++++++++++ tapset/linux/syscalls.stp | 19 -------------- 3 files changed, 51 insertions(+), 38 deletions(-) create mode 100644 tapset/linux/sysc_getgid.stp diff --git a/tapset/linux/nd_syscalls.stp b/tapset/linux/nd_syscalls.stp index b99d8b622..5d0e6abc7 100644 --- a/tapset/linux/nd_syscalls.stp +++ b/tapset/linux/nd_syscalls.stp @@ -1,23 +1,4 @@ -# getgid _____________________________________________________ -# long sys_getgid(void) -# long sys32_getgid16(void) -# -probe nd_syscall.getgid = kprobe.function("sys_getgid16") ?, - kprobe.function("sys32_getgid16") ?, - kprobe.function("sys_getgid") -{ - name = "getgid" - argstr = "" -} -probe nd_syscall.getgid.return = kprobe.function("sys_getgid16").return ?, - kprobe.function("sys32_getgid16").return ?, - kprobe.function("sys_getgid").return -{ - name = "getgid" - retstr = returnstr(1) -} - # getgroups __________________________________________________ # long sys_getgroups(int gidsetsize, gid_t __user *grouplist) # long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist) diff --git a/tapset/linux/sysc_getgid.stp b/tapset/linux/sysc_getgid.stp new file mode 100644 index 000000000..fc737e46c --- /dev/null +++ b/tapset/linux/sysc_getgid.stp @@ -0,0 +1,51 @@ +# getgid _____________________________________________________ +# long sys_getgid(void) +# long sys32_getgid16(void) +# + +@define _SYSCALL_GETGID_NAME +%( + name = "getgid" +%) + +@define _SYSCALL_GETGID_ARGSTR +%( + argstr = "" +%) + +probe syscall.getgid = dw_syscall.getgid !, nd_syscall.getgid {} +probe syscall.getgid.return = dw_syscall.getgid.return !, nd_syscall.getgid.return {} + +# dw_getgid _____________________________________________________ + +probe dw_syscall.getgid = kernel.function("sys_getgid16").call ?, + kernel.function("sys32_getgid16").call ?, + kernel.function("sys_getgid").call +{ + @_SYSCALL_GETGID_NAME + @_SYSCALL_GETGID_ARGSTR +} +probe dw_syscall.getgid.return = kernel.function("sys_getgid16").return ?, + kernel.function("sys32_getgid16").return ?, + kernel.function("sys_getgid").return +{ + @_SYSCALL_GETGID_NAME + retstr = return_str(1, $return) +} + +# nd_getgid _____________________________________________________ + +probe nd_syscall.getgid = kprobe.function("sys_getgid16") ?, + kprobe.function("sys32_getgid16") ?, + kprobe.function("sys_getgid") +{ + @_SYSCALL_GETGID_NAME + @_SYSCALL_GETGID_ARGSTR +} +probe nd_syscall.getgid.return = kprobe.function("sys_getgid16").return ?, + kprobe.function("sys32_getgid16").return ?, + kprobe.function("sys_getgid").return +{ + @_SYSCALL_GETGID_NAME + retstr = returnstr(1) +} diff --git a/tapset/linux/syscalls.stp b/tapset/linux/syscalls.stp index 2e08a91ea..e73b285e5 100644 --- a/tapset/linux/syscalls.stp +++ b/tapset/linux/syscalls.stp @@ -1,23 +1,4 @@ -# getgid _____________________________________________________ -# long sys_getgid(void) -# long sys32_getgid16(void) -# -probe syscall.getgid = kernel.function("sys_getgid16").call ?, - kernel.function("sys32_getgid16").call ?, - kernel.function("sys_getgid").call -{ - name = "getgid" - argstr = "" -} -probe syscall.getgid.return = kernel.function("sys_getgid16").return ?, - kernel.function("sys32_getgid16").return ?, - kernel.function("sys_getgid").return -{ - name = "getgid" - retstr = return_str(1, $return) -} - # getgroups __________________________________________________ # long sys_getgroups(int gidsetsize, gid_t __user *grouplist) # long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist) -- 2.43.5