403Webshell
Server IP : 103.4.122.14  /  Your IP : 216.73.216.103
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux cwp2.slnet.com.au 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : statewid ( 1251)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/systemtap/tapset/linux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/systemtap/tapset/linux/sysc_getcpu.stp
# getcpu _____________________________________________________
# getcpu() was added in kernel 2.6.19 for x86_64 and i386.
# Note that the 'tcache' argument is unused since Linux 2.6.24.
#
# SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
#		  struct getcpu_cache __user *, unused)

@define _SYSCALL_GETCPU_NAME
%(
	name = "getcpu"
%)

@define _SYSCALL_GETCPU_ARGSTR
%(
	argstr = sprintf("%p, %p, %p", cpu_uaddr, node_uaddr, tcache_uaddr)
%)

@define _SYSCALL_GETCPU_REGARGS
%(
	cpu_uaddr = pointer_arg(1)
	node_uaddr = pointer_arg(2)
	tcache_uaddr = pointer_arg(3)
%)

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

# dw_getcpu _____________________________________________________

probe dw_syscall.getcpu = kernel.function("sys_getcpu").call ?
{
	@_SYSCALL_GETCPU_NAME
	cpu_uaddr = $cpup
	node_uaddr = $nodep
	tcache_uaddr = @choose_defined($unused, $cache)
	@_SYSCALL_GETCPU_ARGSTR
}
probe dw_syscall.getcpu.return = kernel.function("sys_getcpu").return ?
{
	@_SYSCALL_GETCPU_NAME
	@SYSC_RETVALSTR($return)
}

# nd_getcpu _____________________________________________________

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

probe nd1_syscall.getcpu = kprobe.function("sys_getcpu") ?
{
	@_SYSCALL_GETCPU_NAME
	asmlinkage()
	@_SYSCALL_GETCPU_REGARGS
	@_SYSCALL_GETCPU_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.getcpu = kprobe.function(@arch_syscall_prefix "sys_getcpu") ?
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_GETCPU_NAME
	@_SYSCALL_GETCPU_REGARGS
	@_SYSCALL_GETCPU_ARGSTR
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.getcpu = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_getcpu"), @const("__NR_compat_getcpu"))
	@_SYSCALL_GETCPU_NAME
	@_SYSCALL_GETCPU_REGARGS
	@_SYSCALL_GETCPU_ARGSTR
}

probe nd_syscall.getcpu.return = nd1_syscall.getcpu.return!, nd2_syscall.getcpu.return!, tp_syscall.getcpu.return
  { }
  
probe nd1_syscall.getcpu.return = kprobe.function("sys_getcpu").return ?
{
	@_SYSCALL_GETCPU_NAME
	@SYSC_RETVALSTR(returnval())
}

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

Youez - 2016 - github.com/yon3zu
LinuXploit