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_readv.stp
# readv ______________________________________________________
#
# ssize_t sys_readv(unsigned long fd,
#		const struct iovec __user *vec,
#		unsigned long vlen)
# ssize_t compat_sys_readv(unsigned long fd,
#		const struct compat_iovec __user *vec,
#		unsigned long vlen)
#

@define _SYSCALL_READV_NAME
%(
	name = "readv"
%)

@define _SYSCALL_READV_ARGSTR
%(
	argstr = sprintf("%d, %p, %d", fd, vector_uaddr, count)
%)

@define _SYSCALL_READV_REGARGS
%(
	vector_uaddr = pointer_arg(2)
	count = int_arg(3)
	fd = int_arg(1)
%)

@define _SYSCALL_READV_REGARGS_STORE
%(
	if (@probewrite(fd))
	  set_int_arg(1, fd)

        if (@probewrite(vector_uaddr))
          set_pointer_arg(2, vector_uaddr)

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

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

# dw_readv _____________________________________________________

probe dw_syscall.readv = kernel.function("compat_sys_readv").call ?,
                      kernel.function("sys_readv").call
{
	@_SYSCALL_READV_NAME
	vector_uaddr = $vec
	count = __int32($vlen)
	# Although the kernel gets an unsigned long fd, on the
	# user-side it is a signed int.  Fix this.
	fd = __int32($fd)
	@_SYSCALL_READV_ARGSTR
}
probe dw_syscall.readv.return = kernel.function("compat_sys_readv").return ?,
                             kernel.function("sys_readv").return
{
	@_SYSCALL_READV_NAME
	@SYSC_RETVALSTR($return)
}

# nd_readv _____________________________________________________

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

probe nd1_syscall.readv = kprobe.function("compat_sys_readv") ?,
                          kprobe.function("sys_readv") ?
{
	@_SYSCALL_READV_NAME
	asmlinkage()
	@_SYSCALL_READV_REGARGS
	@_SYSCALL_READV_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.readv = kprobe.function(@arch_syscall_prefix "sys_readv") ?,
                          kprobe.function(@arch_syscall_prefix "compat_sys_readv") ?
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_READV_NAME
	@_SYSCALL_READV_REGARGS
	@_SYSCALL_READV_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_READV_REGARGS_STORE %)
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.readv = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_readv"), @const("__NR_compat_readv"))
	@_SYSCALL_READV_NAME
	@_SYSCALL_READV_REGARGS
	@_SYSCALL_READV_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_READV_REGARGS_STORE %)
}

probe nd_syscall.readv.return = nd1_syscall.readv.return!, nd2_syscall.readv.return!, tp_syscall.readv.return
  { }
  
probe nd1_syscall.readv.return = kprobe.function("compat_sys_readv").return ?,
                                 kprobe.function("sys_readv").return ?
{
	@_SYSCALL_READV_NAME
	@SYSC_RETVALSTR(returnval())
}

/* kernel 4.17+ */
probe nd2_syscall.readv.return = kprobe.function(@arch_syscall_prefix "sys_readv").return ?,
                                 kprobe.function(@arch_syscall_prefix "compat_sys_readv").return ?
{
	@_SYSCALL_READV_NAME
	@SYSC_RETVALSTR(returnval())
}
 
/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.readv.return = kernel.trace("sys_exit")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_readv"), @const("__NR_compat_readv"))
	@_SYSCALL_READV_NAME
	@SYSC_RETVALSTR($ret)
}

Spamworldpro Mini