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_pwritev.stp
# pwritev ___________________________________________________
#
# sys_pwritev(unsigned long fd, const struct iovec __user * vec,
#             unsigned long vlen, unsigned long pos_l, unsigned long pos_h)
# compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec,
#                    unsigned long vlen, u32 pos_low, u32 pos_high)
#

@define _SYSCALL_PWRITEV_NAME
%(
	name = "pwritev"
%)

@define _SYSCALL_PWRITEV_ARGSTR
%(
	argstr = sprintf("%d, %p, %d, 0x%x", fd, vector_uaddr, count, offset)
%)

@define _SYSCALL_PWRITEV_REGARGS
%(
	fd = int_arg(1)
	vector_uaddr = pointer_arg(2)
	count = int_arg(3)
	offset = @__pos_from_hilo(ulong_arg(5), ulong_arg(4))
%)

@define _SYSCALL_PWRITEV_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)

        if (@probewrite(offset)) {
          set_ulong_arg(4, __ulong(offset))
          set_ulong_arg(5, __ulong(offset >> 32))
        }
%)

@define _SYSCALL_COMPAT_PWRITEV_REGARGS
%(
	fd = int_arg(1)
	vector_uaddr = pointer_arg(2)
	count = int_arg(3)
	offset = (u32_arg(5) << 32) + u32_arg(4)
%)

@define _SYSCALL_COMPAT_PWRITEV_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)

        if (@probewrite(offset)) {
          set_u32_arg(4, offset & 0xffffffff)
          set_u32_arg(5, offset >> 32)
        }
%)

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

# dw_pwritev _____________________________________________________

probe dw_syscall.pwritev = __syscall.pwritev ?, __syscall.compat_pwritev ?
{
	@_SYSCALL_PWRITEV_NAME
}
probe __syscall.pwritev = kernel.function("sys_pwritev").call
{
	fd = __int32($fd)
	vector_uaddr = $vec
	count = __int32($vlen)
	offset = @__pos_from_hilo($pos_h, $pos_l)
	@_SYSCALL_PWRITEV_ARGSTR
}
probe __syscall.compat_pwritev = kernel.function("compat_sys_pwritev").call
{
	fd = __int32($fd)
	vector_uaddr = $vec
	count = __int32($vlen)
	offset = ($pos_high << 32) + __uint32($pos_low)
	@_SYSCALL_PWRITEV_ARGSTR
}
probe dw_syscall.pwritev.return = kernel.function("sys_pwritev").return ?,
			       kernel.function("compat_sys_pwritev").return ?
{
	@_SYSCALL_PWRITEV_NAME
	@SYSC_RETVALSTR($return)
}

# nd_pwritev _____________________________________________________

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

probe nd1_syscall.pwritev = __nd1_syscall.pwritev ?,
			    __nd1_syscall.compat_pwritev ?
{
	@_SYSCALL_PWRITEV_NAME
}
probe __nd1_syscall.pwritev = kprobe.function("sys_pwritev").call
{
	asmlinkage()
	@_SYSCALL_PWRITEV_REGARGS
	@_SYSCALL_PWRITEV_ARGSTR
}
probe __nd1_syscall.compat_pwritev = kprobe.function("compat_sys_pwritev").call
{
	asmlinkage()
	@_SYSCALL_COMPAT_PWRITEV_REGARGS
	@_SYSCALL_PWRITEV_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.pwritev = __nd2_syscall.pwritev ?,
			    __nd2_syscall.compat_pwritev ?
{
	@_SYSCALL_PWRITEV_NAME
}
probe __nd2_syscall.pwritev = kprobe.function(@arch_syscall_prefix "sys_pwritev").call
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_PWRITEV_REGARGS
	@_SYSCALL_PWRITEV_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_PWRITEV_REGARGS_STORE %)
}
probe __nd2_syscall.compat_pwritev = kprobe.function(@arch_syscall_prefix "compat_sys_pwritev").call
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_COMPAT_PWRITEV_REGARGS
	@_SYSCALL_PWRITEV_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_COMPAT_PWRITEV_REGARGS_STORE %)
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.pwritev = __tp_syscall.pwritev ?,
			   __tp_syscall.compat_pwritev ?
{
	@_SYSCALL_PWRITEV_NAME
}
probe __tp_syscall.pwritev = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__syscall_gate(@const("__NR_pwritev"))
	@_SYSCALL_PWRITEV_REGARGS
	@_SYSCALL_PWRITEV_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_PWRITEV_REGARGS_STORE %)
}
probe __tp_syscall.compat_pwritev = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__compat_syscall_gate(@const("__NR_compat_pwritev"))
	@_SYSCALL_COMPAT_PWRITEV_REGARGS
	@_SYSCALL_PWRITEV_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_COMPAT_PWRITEV_REGARGS_STORE %)
}

probe nd_syscall.pwritev.return = nd1_syscall.pwritev.return!, nd2_syscall.pwritev.return!, tp_syscall.pwritev.return
  { }
  
probe nd1_syscall.pwritev.return =
	kprobe.function("sys_pwritev").return ?,
	kprobe.function("compat_sys_pwritev").return ?
{
	@_SYSCALL_PWRITEV_NAME
	@SYSC_RETVALSTR(returnval())
}

/* kernel 4.17+ */
probe nd2_syscall.pwritev.return =
	kprobe.function(@arch_syscall_prefix "sys_pwritev").return ?,
	kprobe.function(@arch_syscall_prefix "compat_sys_pwritev").return ?
{
	@_SYSCALL_PWRITEV_NAME
	@SYSC_RETVALSTR(returnval())
}
 
/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.pwritev.return = kernel.trace("sys_exit")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_pwritev"), @const("__NR_compat_pwritev"))
	@_SYSCALL_PWRITEV_NAME
	@SYSC_RETVALSTR($ret)
}

Spamworldpro Mini