| Server IP : 118.27.122.120 / Your IP : 216.73.216.136 Web Server : Apache System : Linux web0216.sh.tyo1 4.18.0-553.141.2.lve.el7h.x86_64 #1 SMP Wed Jul 8 17:20:31 UTC 2026 x86_64 User : r4834334 ( 11094) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/opt/rh/devtoolset-8/root/usr/share/systemtap/tapset/linux/ |
Upload File : |
# setuid _____________________________________________________
#
# long sys_setuid(uid_t uid)
# long sys_setuid16(old_uid_t uid)
#
@define _SYSCALL_SETUID_NAME
%(
name = "setuid"
%)
@define _SYSCALL_SETUID_ARGSTR
%(
argstr = sprint(uid)
%)
@define _SYSCALL_GATE
%(
%( arch == "x86_64" %?
// There are actually 3 x86_64 setuid syscall numbers (which
// get mapped to 2 syscall functions:
// - __NR_setuid which gets mapped to sys_setuid()
// - __NR_ia32_setuid32 which also gets mapped to
// sys_setuid()
// - __NR_ia32_setuid which gets mapped to sys_setuid16()
// (which is a wrapper around sys_setuid())
// So, we need to avoid sys_setuid() calls that come from
// sys_setuid16().
@__syscall_compat_gate(@const("__NR_setuid"),
@const("__NR_ia32_setuid32"))
%:
%( arch == "i386" %?
// On i386, there are 2 setuid syscall numbers:
// - __NR_setuid which gets mapped to sys_setuid16
// - __NR_setuid32 which gets mapped to sys_setuid
// Since this gets called from a probe on sys_setuid, we'll
// make sure this is really __NR_setuid32.
@__syscall_nr_gate(@const("__NR_setuid32"))
%)
%)
%)
probe syscall.setuid = dw_syscall.setuid !, nd_syscall.setuid ? {}
probe syscall.setuid.return = dw_syscall.setuid.return !,
nd_syscall.setuid.return ? {}
# dw_setuid _____________________________________________________
probe dw_syscall.setuid = kernel.function("sys_setuid16").call ?,
__syscall.setuid ?
{
@_SYSCALL_SETUID_NAME
uid = __int32($uid)
@_SYSCALL_SETUID_ARGSTR
}
probe __syscall.setuid = kernel.function("sys_setuid").call ?
{
@_SYSCALL_GATE
}
probe dw_syscall.setuid.return = kernel.function("sys_setuid16").return ?,
__syscall.setuid.return ?
{
@_SYSCALL_SETUID_NAME
retstr = return_str(1, $return)
}
probe __syscall.setuid.return = kernel.function("sys_setuid").return ?
{
@_SYSCALL_GATE
}
# nd_setuid _____________________________________________________
probe nd_syscall.setuid = kprobe.function("sys_setuid16") ?,
__nd_syscall.setuid ?
{
@_SYSCALL_SETUID_NAME
asmlinkage()
uid = int_arg(1)
@_SYSCALL_SETUID_ARGSTR
}
probe __nd_syscall.setuid = kprobe.function("sys_setuid") ?
{
@_SYSCALL_GATE
}
probe nd_syscall.setuid.return = kprobe.function("sys_setuid16").return ?,
__nd_syscall.setuid.return ?
{
@_SYSCALL_SETUID_NAME
retstr = returnstr(1)
}
probe __nd_syscall.setuid.return = kprobe.function("sys_setuid").return ?
{
@_SYSCALL_GATE
}