Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/linux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/linux/sysc_setpriority.stp
# setpriority ________________________________________________
#
# asmlinkage long
# sys_setpriority(int which,
#		     int who,
#		     int niceval)
#

@define _SYSCALL_SETPRIORITY_NAME
%(
	name = "setpriority"
%)

@define _SYSCALL_SETPRIORITY_ARGSTR
%(
	argstr = sprintf("%s, %d, %d", which_str, who, prio)
%)

@define _SYSCALL_SETPRIORITY_REGARGS
%(
	which = int_arg(1)
	which_str = _priority_which_str(which)
	who = int_arg(2)
	prio = int_arg(3)
%)

@define _SYSCALL_SETPRIORITY_REGARGS_STORE
%(
        if (@probewrite(which))
          set_int_arg(1, which)

	if (@probewrite(who))
	  set_int_arg(2, who)

	if (@probewrite(prio))
	  set_int_arg(3, prio)
%)

probe syscall.setpriority = dw_syscall.setpriority !, nd_syscall.setpriority ? {}
probe syscall.setpriority.return = dw_syscall.setpriority.return !,
                                   nd_syscall.setpriority.return ? {}

# dw_setpriority _____________________________________________________

probe dw_syscall.setpriority = kernel.function("sys_setpriority").call
{
	@_SYSCALL_SETPRIORITY_NAME
	which = __int32($which)
	which_str = _priority_which_str(__int32($which))
	who = __int32($who)
	prio = __int32($niceval)
	@_SYSCALL_SETPRIORITY_ARGSTR
}
probe dw_syscall.setpriority.return = kernel.function("sys_setpriority").return
{
	@_SYSCALL_SETPRIORITY_NAME
	@SYSC_RETVALSTR($return)
}

# nd_setpriority _____________________________________________________

probe nd_syscall.setpriority = nd1_syscall.setpriority!, nd2_syscall.setpriority!, tp_syscall.setpriority
  { }

probe nd1_syscall.setpriority = kprobe.function("sys_setpriority") ?
{
	@_SYSCALL_SETPRIORITY_NAME
	asmlinkage()
	@_SYSCALL_SETPRIORITY_REGARGS
	@_SYSCALL_SETPRIORITY_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.setpriority = kprobe.function(@arch_syscall_prefix "sys_setpriority") ?
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_SETPRIORITY_NAME
	@_SYSCALL_SETPRIORITY_REGARGS
	@_SYSCALL_SETPRIORITY_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_SETPRIORITY_REGARGS_STORE %)
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.setpriority = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_setpriority"), @const("__NR_compat_setpriority"))
	@_SYSCALL_SETPRIORITY_NAME
	@_SYSCALL_SETPRIORITY_REGARGS
	@_SYSCALL_SETPRIORITY_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_SETPRIORITY_REGARGS_STORE %)
}

probe nd_syscall.setpriority.return = nd1_syscall.setpriority.return!, nd2_syscall.setpriority.return!, tp_syscall.setpriority.return
  { }
  
probe nd1_syscall.setpriority.return = kprobe.function("sys_setpriority").return ?
{
	@_SYSCALL_SETPRIORITY_NAME
	@SYSC_RETVALSTR(returnval())
}

/* kernel 4.17+ */
probe nd2_syscall.setpriority.return = kprobe.function(@arch_syscall_prefix "sys_setpriority").return ?
{
	@_SYSCALL_SETPRIORITY_NAME
	@SYSC_RETVALSTR(returnval())
}
 
/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.setpriority.return = kernel.trace("sys_exit")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_setpriority"), @const("__NR_compat_setpriority"))
	@_SYSCALL_SETPRIORITY_NAME
	@SYSC_RETVALSTR($ret)
}

Spamworldpro Mini