# This is arch specific syscall table generated by scripts/dump-syscalls.sh
-global __syscall_64_num2name[331]
-global __syscall_64_name2num[331]
+global __syscall_64_num2name[332]
+global __syscall_64_name2num[332]
probe init {
__syscall_64_num2name[0]="io_setup"
__syscall_64_name2num["pkey_alloc"]=289
__syscall_64_num2name[290]="pkey_free"
__syscall_64_name2num["pkey_free"]=290
+__syscall_64_num2name[291]="statx"
+__syscall_64_name2num["statx"]=291
__syscall_64_num2name[1024]="open"
__syscall_64_name2num["open"]=1024
__syscall_64_num2name[1025]="link"
@__private30 function _stp_struct_iovec_u:string(iov_uaddr:long)
%{ /* pure */
char *iov_uaddr = (void *)(intptr_t)STAP_ARG_iov_uaddr;
- struct iovec iov;
+ struct iovec iov = { 0 };
if (iov_uaddr == NULL)
strlcpy(STAP_RETVALUE, "NULL", MAXSTRINGLEN);
else {
%{ /* pure */
#ifdef CONFIG_COMPAT
char *iov_uaddr = (void *)(intptr_t)STAP_ARG_iov_uaddr;
- struct compat_iovec iov;
+ struct compat_iovec iov = { 0 };
if (iov_uaddr == NULL)
strlcpy(STAP_RETVALUE, "NULL", MAXSTRINGLEN);
else {
global __syscall_32_num2name[382]
global __syscall_32_name2num[382]
-global __syscall_64_num2name[373]
-global __syscall_64_name2num[373]
+global __syscall_64_num2name[374]
+global __syscall_64_name2num[374]
probe init {
__syscall_32_num2name[0]="restart_syscall"
__syscall_32_name2num["switch_endian"]=363
__syscall_32_num2name[364]="userfaultfd"
__syscall_32_name2num["userfaultfd"]=364
-__syscall_32_num2name[365]="membarrier"
-__syscall_32_name2num["membarrier"]=365
+__syscall_32_num2name[365]="copy_file_range"
+__syscall_32_name2num["copy_file_range"]=365
__syscall_32_num2name[366]="semop"
__syscall_32_name2num["semop"]=366
__syscall_32_num2name[367]="semget"
__syscall_64_name2num["pwritev2"]=381
__syscall_64_num2name[382]="kexec_file_load"
__syscall_64_name2num["kexec_file_load"]=382
+__syscall_64_num2name[383]="statx"
+__syscall_64_name2num["statx"]=383
} /* probe init */
// Get _stp_val_array and _stp_lookup_* definitions.
#include "linux/syscalls-common.h"
+// PTRACE_SINGLEBLOCK was added in kernel 3.15. However, its value
+// overlaps with PTRACE_GETREGS (which userspace has defined. So,
+// we'll give PTRACE_SINGLEBLOCK a bogus value on earlier kernels.
#ifndef PTRACE_SINGLEBLOCK
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
#define PTRACE_SINGLEBLOCK 12
+#else
+#define PTRACE_SINGLEBLOCK 0xABCDEF12
+#endif
#endif
#ifndef PTRACE_GET_LAST_BREAK
#define PTRACE_GET_LAST_BREAK 0x5006
return sprintf("%s, %d, %#x, %#x",
__arch_ptrace_request_str(request),
pid, addr, data)
+
+ if (request == @const("PTRACE_SINGLEBLOCK"))
+ return sprintf("%s, %d, %#x, %s",
+ __arch_ptrace_request_str(request), pid,
+ addr, _signal_name (data))
}
function _ptrace_return_arch_prctl_addr:long(request:long, addr:long, data:long)
# dw_compat_fadvise64 _____________________________________________________
-probe dw_syscall.compat_fadvise64 = kernel.function("sys32_fadvise64").call ?
+probe dw_syscall.compat_fadvise64 = kernel.function("sys32_fadvise64").call ?,
+ kernel.function("compat_sys_s390_fadvise64").call ?
{
@_SYSCALL_COMPAT_FADVISE64_NAME
fd = __int32($fd)
offset = $offset
}
else {
- offset = (($high << 32) | $low)
+ offset = (($high << 32) | __uint32($low))
}
len = __int32($len)
advice = __int32($advise)
@_SYSCALL_COMPAT_FADVISE64_ARGSTR
}
probe dw_syscall.compat_fadvise64.return =
- kernel.function("sys32_fadvise64").return ?
+ kernel.function("sys32_fadvise64").return ?,
+ kernel.function("compat_sys_s390_fadvise64").return ?
{
@_SYSCALL_COMPAT_FADVISE64_NAME
retstr = return_str(1, $return)
# nd_compat_fadvise64 _____________________________________________________
-probe nd_syscall.compat_fadvise64 = kprobe.function("sys32_fadvise64") ?
+probe nd_syscall.compat_fadvise64 = kprobe.function("sys32_fadvise64") ?,
+ kprobe.function("compat_sys_s390_fadvise64") ?
{
asmlinkage()
@_SYSCALL_COMPAT_FADVISE64_NAME
@_SYSCALL_COMPAT_FADVISE64_ARGSTR
}
probe nd_syscall.compat_fadvise64.return =
- kprobe.function("sys32_fadvise64").return ?
+ kprobe.function("sys32_fadvise64").return ?,
+ kprobe.function("compat_sys_s390_fadvise64").return ?
{
@_SYSCALL_COMPAT_FADVISE64_NAME
retstr = returnstr(1)
# dw_compat_fadvise64_64 _____________________________________________________
-probe dw_syscall.compat_fadvise64_64 = kernel.function("sys32_fadvise64_64").call ?
+probe dw_syscall.compat_fadvise64_64 =
+ kernel.function("sys32_fadvise64_64").call ?,
+ kernel.function("compat_sys_s390_fadvise64_64").call ?
{
@_SYSCALL_COMPAT_FADVISE64_NAME
- fd = user_int(&$args->fd)
- offset = user_int64(&$args->offset)
- len = user_int64(&$args->len)
- advice = user_int(&$args->advice)
+ fd = user_int(&@cast(@__pointer($args), "fadvise64_64_args")->fd)
+ offset = user_int64(&@cast(@__pointer($args), "fadvise64_64_args")->offset)
+ len = user_int64(&@cast(@__pointer($args), "fadvise64_64_args")->len)
+ advice = user_int(&@cast(@__pointer($args), "fadvise64_64_args")->advice)
advice_str = _fadvice_advice_str(advice)
@_SYSCALL_COMPAT_FADVISE64_ARGSTR
}
probe dw_syscall.compat_fadvise64_64.return =
- kernel.function("sys32_fadvise64_64").return ?
+ kernel.function("sys32_fadvise64_64").return ?,
+ kernel.function("compat_sys_s390_fadvise64_64").return ?
{
@_SYSCALL_COMPAT_FADVISE64_NAME
retstr = return_str(1, $return)
# nd_compat_fadvise64_64 _____________________________________________________
-probe nd_syscall.compat_fadvise64_64 = kprobe.function("sys32_fadvise64_64") ?
+probe nd_syscall.compat_fadvise64_64 = kprobe.function("sys32_fadvise64_64") ?,
+ kprobe.function("compat_sys_s390_fadvise64_64") ?
{
@_SYSCALL_COMPAT_FADVISE64_NAME
__args = &@cast(pointer_arg(1), "unsigned int", "kernel<linux/types.h>")
@_SYSCALL_COMPAT_FADVISE64_ARGSTR
}
probe nd_syscall.compat_fadvise64_64.return =
- kprobe.function("sys32_fadvise64_64").return ?
+ kprobe.function("sys32_fadvise64_64").return ?,
+ kprobe.function("compat_sys_s390_fadvise64_64").return ?
{
@_SYSCALL_COMPAT_FADVISE64_NAME
retstr = returnstr(1)
# dw_compat_ftruncate64 _____________________________________________________
-probe dw_syscall.compat_ftruncate64 = kernel.function("sys32_ftruncate64").call ?
+probe dw_syscall.compat_ftruncate64 =
+ kernel.function("sys32_ftruncate64").call ?,
+ kernel.function("compat_sys_s390_ftruncate64").call ?
{
@_SYSCALL_COMPAT_FTRUNCATE64_NAME
fd = __int32($fd)
- length = (($high << 32) | $low)
+ length = (($high << 32) | __uint32($low))
@_SYSCALL_COMPAT_FTRUNCATE64_ARGSTR
}
probe dw_syscall.compat_ftruncate64.return =
- kernel.function("sys32_ftruncate64").return ?
+ kernel.function("sys32_ftruncate64").return ?,
+ kernel.function("compat_sys_s390_ftruncate64").return ?
{
@_SYSCALL_COMPAT_FTRUNCATE64_NAME
retstr = return_str(1, $return)
# nd_compat_ftruncate64 _____________________________________________________
-probe nd_syscall.compat_ftruncate64 = kprobe.function("sys32_ftruncate64") ?
+probe nd_syscall.compat_ftruncate64 = kprobe.function("sys32_ftruncate64") ?,
+ kprobe.function("compat_sys_s390_ftruncate64") ?
{
asmlinkage()
@_SYSCALL_COMPAT_FTRUNCATE64_NAME
@_SYSCALL_COMPAT_FTRUNCATE64_ARGSTR
}
probe nd_syscall.compat_ftruncate64.return =
- kprobe.function("sys32_ftruncate64").return ?
+ kprobe.function("sys32_ftruncate64").return ?,
+ kprobe.function("compat_sys_s390_ftruncate64").return ?
{
@_SYSCALL_COMPAT_FTRUNCATE64_NAME
retstr = returnstr(1)
#
# asmlinkage ssize_t
# compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count)
+# COMPAT_SYSCALL_DEFINE4(s390_readahead, int, fd, u32, high, u32, low,
+# s32, count)
#
@define _SYSCALL_COMPAT_READAHEAD_NAME
# dw_compat_readahead _____________________________________________________
-probe dw_syscall.compat_readahead = kernel.function("sys32_readahead") ?
+probe dw_syscall.compat_readahead = kernel.function("sys32_readahead").call ?,
+ kernel.function("compat_sys_s390_readahead").call ?
{
@_SYSCALL_COMPAT_READAHEAD_NAME
fd = __int32($fd)
- offset = (($offhi << 32) | $offlo)
+ offset = ((@choose_defined($offhi, $high) << 32)
+ | __uint32(@choose_defined($offlo, $low)))
count = __uint32($count)
@_SYSCALL_COMPAT_READAHEAD_ARGSTR
}
-probe dw_syscall.compat_readahead.return = kernel.function("sys32_readahead").return ?
+probe dw_syscall.compat_readahead.return =
+ kernel.function("sys32_readahead").return ?,
+ kernel.function("compat_sys_s390_readahead").return ?
{
@_SYSCALL_COMPAT_READAHEAD_NAME
retstr = return_str(1, $return)
# nd_compat_readahead _____________________________________________________
-probe nd_syscall.compat_readahead = kprobe.function("sys32_readahead") ?
+probe nd_syscall.compat_readahead = kprobe.function("sys32_readahead") ?,
+ kprobe.function("compat_sys_s390_readahead") ?
{
@_SYSCALL_COMPAT_READAHEAD_NAME
asmlinkage()
count = ulong_arg(4)
@_SYSCALL_COMPAT_READAHEAD_ARGSTR
}
-probe nd_syscall.compat_readahead.return = kprobe.function("sys32_readahead").return ?
+probe nd_syscall.compat_readahead.return =
+ kprobe.function("sys32_readahead").return ?,
+ kprobe.function("compat_sys_s390_readahead").return ?
{
@_SYSCALL_COMPAT_READAHEAD_NAME
retstr = returnstr(1)
# dw_compat_truncate64 _____________________________________________________
-probe dw_syscall.compat_truncate64 = kernel.function("sys32_truncate64").call ?
+probe dw_syscall.compat_truncate64 = kernel.function("sys32_truncate64").call ?,
+ kernel.function("compat_sys_s390_truncate64").call ?
{
@_SYSCALL_COMPAT_TRUNCATE64_NAME
- path_uaddr = $path
+ path_uaddr = @__pointer($path)
path = user_string_quoted(path_uaddr)
- length = (($high << 32) | $low)
+ length = (($high << 32) | __uint32($low))
@_SYSCALL_COMPAT_TRUNCATE64_ARGSTR
}
probe dw_syscall.compat_truncate64.return =
- kernel.function("sys32_truncate64").return ?
+ kernel.function("sys32_truncate64").return ?,
+ kernel.function("compat_sys_s390_truncate64").return ?
{
@_SYSCALL_COMPAT_TRUNCATE64_NAME
retstr = return_str(1, $return)
# nd_compat_truncate64 _____________________________________________________
-probe nd_syscall.compat_truncate64 = kprobe.function("sys32_truncate64") ?
+probe nd_syscall.compat_truncate64 = kprobe.function("sys32_truncate64") ?,
+ kprobe.function("compat_sys_s390_truncate64") ?
{
asmlinkage()
@_SYSCALL_COMPAT_TRUNCATE64_NAME
@_SYSCALL_COMPAT_TRUNCATE64_ARGSTR
}
probe nd_syscall.compat_truncate64.return =
- kprobe.function("sys32_truncate64").return ?
+ kprobe.function("sys32_truncate64").return ?,
+ kprobe.function("compat_sys_s390_truncate64").return ?
{
@_SYSCALL_COMPAT_TRUNCATE64_NAME
retstr = returnstr(1)
# dw_getresgid16 _____________________________________________________
-probe dw_syscall.getresgid16 = kernel.function("sys32_getresgid16") ?
+probe dw_syscall.getresgid16 = kernel.function("sys32_getresgid16").call ?,
+ kernel.function("compat_sys_s390_getresgid16").call ?
{
@_SYSCALL_GETRESGID16_NAME
rgid_uaddr = @choose_defined($rgidp, $rgid)
sgid_uaddr = @choose_defined($sgidp, $sgid)
@_SYSCALL_GETRESGID16_ARGSTR
}
-probe dw_syscall.getresgid16.return = kernel.function("sys32_getresgid16").return ?
+probe dw_syscall.getresgid16.return =
+ kernel.function("sys32_getresgid16").return ?,
+ kernel.function("compat_sys_s390_getresgid16").return ?
{
@_SYSCALL_GETRESGID16_NAME
retstr = return_str(1, $return)
# nd_getresgid16 _____________________________________________________
-probe nd_syscall.getresgid16 = kprobe.function("sys32_getresgid16") ?
+probe nd_syscall.getresgid16 = kprobe.function("sys32_getresgid16") ?,
+ kprobe.function("compat_sys_s390_getresgid16") ?
{
@_SYSCALL_GETRESGID16_NAME
asmlinkage()
sgid_uaddr = pointer_arg(3)
@_SYSCALL_GETRESGID16_ARGSTR
}
-probe nd_syscall.getresgid16.return = kprobe.function("sys32_getresgid16").return ?
+probe nd_syscall.getresgid16.return =
+ kprobe.function("sys32_getresgid16").return ?,
+ kprobe.function("compat_sys_s390_getresgid16").return ?
{
@_SYSCALL_GETRESGID16_NAME
retstr = returnstr(1)
# dw_getresuid16 _____________________________________________________
-probe dw_syscall.getresuid16 = kernel.function("sys32_getresuid16") ?
+probe dw_syscall.getresuid16 = kernel.function("sys32_getresuid16").call ?,
+ kernel.function("compat_sys_s390_getresuid16").call ?
{
@_SYSCALL_GETRESUID16_NAME
ruid_uaddr = @choose_defined($ruidp, $ruid)
suid_uaddr = @choose_defined($suidp, $suid)
@_SYSCALL_GETRESUID16_ARGSTR
}
-probe dw_syscall.getresuid16.return = kernel.function("sys32_getresuid16").return ?
+probe dw_syscall.getresuid16.return =
+ kernel.function("sys32_getresuid16").return ?,
+ kernel.function("compat_sys_s390_getresuid16").return ?
{
@_SYSCALL_GETRESUID16_NAME
retstr = return_str(1, $return)
# nd_getresuid16 _____________________________________________________
-probe nd_syscall.getresuid16 = kprobe.function("sys32_getresuid16") ?
+probe nd_syscall.getresuid16 = kprobe.function("sys32_getresuid16") ?,
+ kprobe.function("compat_sys_s390_getresuid16") ?
{
@_SYSCALL_GETRESUID16_NAME
asmlinkage()
suid_uaddr = pointer_arg(3)
@_SYSCALL_GETRESUID16_ARGSTR
}
-probe nd_syscall.getresuid16.return = kprobe.function("sys32_getresuid16").return ?
+probe nd_syscall.getresuid16.return =
+ kprobe.function("sys32_getresuid16").return ?,
+ kprobe.function("compat_sys_s390_getresuid16").return ?
{
@_SYSCALL_GETRESUID16_NAME
retstr = returnstr(1)
# This is arch specific syscall table generated by scripts/dump-syscalls.sh
-global __syscall_32_num2name[357]
-global __syscall_32_name2num[357]
-global __syscall_64_num2name[324]
-global __syscall_64_name2num[324]
+global __syscall_32_num2name[358]
+global __syscall_32_name2num[358]
+global __syscall_64_num2name[325]
+global __syscall_64_name2num[325]
probe init {
__syscall_32_num2name[0]="setup"
__syscall_32_name2num["preadv2"]=376
__syscall_32_num2name[377]="pwritev2"
__syscall_32_name2num["pwritev2"]=377
+__syscall_32_num2name[379]="statx"
+__syscall_32_name2num["statx"]=379
__syscall_64_num2name[0]="setup"
__syscall_64_name2num["setup"]=0
__syscall_64_num2name[1]="exit"
__syscall_64_name2num["preadv2"]=376
__syscall_64_num2name[377]="pwritev2"
__syscall_64_name2num["pwritev2"]=377
+__syscall_64_num2name[379]="statx"
+__syscall_64_name2num["statx"]=379
} /* probe init */
}
probe __syscall.socketcall.accept = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_ACCEPT")) next;
+ if (__int32($call) != @const("SYS_ACCEPT")) next;
sockfd = __int32(user_ulong(&@cast($args, "ulong")[0]))
addr_uaddr = user_ulong(&@cast($args, "ulong")[1])
addrlen_uaddr = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.accept =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_ACCEPT")) next;
+ if (__int32($call) != @const("SYS_ACCEPT")) next;
sockfd = user_int(&@cast($args, "unsigned int")[0])
addr_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
addrlen_uaddr = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_ACCEPT")) next;
+ if (__int32(@entry($call)) != @const("SYS_ACCEPT")) next;
}
# nd_accept _____________________________________________________
}
probe __syscall.socketcall.accept4 = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_ACCEPT4")) next;
+ if (__int32($call) != @const("SYS_ACCEPT4")) next;
sockfd = __int32(user_ulong(&@cast($args, "ulong")[0]))
addr_uaddr = user_ulong(&@cast($args, "ulong")[1])
addrlen_uaddr = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.accept4 =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_ACCEPT4")) next;
+ if (__int32($call) != @const("SYS_ACCEPT4")) next;
sockfd = user_int(&@cast($args, "unsigned int")[0])
addr_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
addrlen_uaddr = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_ACCEPT4")) next;
+ if (__int32(@entry($call)) != @const("SYS_ACCEPT4")) next;
}
# nd_accept4 _____________________________________________________
}
probe __syscall.socketcall.bind = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_BIND")) next;
+ if (__int32($call) != @const("SYS_BIND")) next;
sockfd = __int32(user_ulong(&@cast($args, "ulong")[0]))
my_addr_uaddr = user_ulong(&@cast($args, "ulong")[1])
addrlen = __int32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.compat_socketcall.bind =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_BIND")) next;
+ if (__int32($call) != @const("SYS_BIND")) next;
sockfd = user_int(&@cast($args, "unsigned int")[0])
my_addr_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
addrlen = user_int(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_BIND")) next;
+ if (__int32(@entry($call)) != @const("SYS_BIND")) next;
}
# nd_bind _____________________________________________________
flag_str = _stp_clock_nanosleep_flags_str(__int32($flags))
%)
flags_str = _stp_clock_nanosleep_flags_str(__int32($flags))
- req_uaddr = $rqtp
+ req_uaddr = @__pointer($rqtp)
req_str = _struct_compat_timespec_u(req_uaddr, 1)
rem_uaddr = $rmtp
@_SYSCALL_CLOCK_NANOSLEEP_ARGSTR
}
probe __syscall.socketcall.connect = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_CONNECT")) next;
+ if (__int32($call) != @const("SYS_CONNECT")) next;
sockfd = __int32(user_ulong(&@cast($args, "ulong")[0]))
serv_addr_uaddr = user_ulong(&@cast($args, "ulong")[1])
addrlen = __uint32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.compat_socketcall.connect =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_CONNECT")) next;
+ if (__int32($call) != @const("SYS_CONNECT")) next;
sockfd = user_int(&@cast($args, "unsigned int")[0])
serv_addr_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
addrlen = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_CONNECT")) next;
+ if (__int32(@entry($call)) != @const("SYS_CONNECT")) next;
}
# nd_connect _____________________________________________________
@define _SYSCALL_COPY_FILE_RANGE_ARGSTR
%(
- argstr = sprintf("%d, %p, %d, %p, %d, 0x%x", fd_in, off_in, fd_out,
+ argstr = sprintf("%d, %p, %d, %p, %u, 0x%x", fd_in, off_in, fd_out,
off_out, len, flags)
%)
{
@_SYSCALL_COPY_FILE_RANGE_NAME
fd_in = __int32($fd_in)
- off_in = $off_in
+ off_in = @__pointer($off_in)
fd_out = __int32($fd_out)
- off_out = $off_out
+ off_out = @__pointer($off_out)
len = __ulong($len)
flags = __uint32($flags)
@_SYSCALL_COPY_FILE_RANGE_ARGSTR
probe dw_syscall.compat_execve = kernel.function("compat_sys_execve").call ?
{
@_SYSCALL_EXECVE_NAME
- filename = user_string_quoted($filename)
+ filename = user_string_quoted(@__pointer($filename))
# kernel 3.0 changed the pointer's name to __argv
- __argv = @choose_defined($__argv, $argv)
+ __argv = @__pointer(@choose_defined($__argv, $argv))
args = __get_compat_argv(__argv, 0)
- __envp = @choose_defined($__envp, $envp)
+ __envp = @__pointer(@choose_defined($__envp, $envp))
env_str = __count_compat_envp(__envp)
@_SYSCALL_EXECVE_ARGSTR
}
fd_str = dirfd_str
%)
filename = user_string_quoted(@__pointer($filename))
- flags = int_arg($flags)
- flags_str = _at_flag_str(__int32($flags))
- __argv = @choose_defined($__argv, $argv)
+ flags = __int32($flags)
+ flags_str = _at_flag_str(__int32($flags))
+ __argv = @__pointer(@choose_defined($__argv, $argv))
args = __get_compat_argv(__argv, 0)
- __envp = @choose_defined($__envp, $envp)
+ __envp = @__pointer(@choose_defined($__envp, $envp))
env_str = __count_compat_envp(__envp)
@_SYSCALL_EXECVEAT_ARGSTR
}
fd = __int32($fd)
cmd = __int32($cmd)
cmd_str = _fcntl_cmd_str(cmd)
- arg = $arg
+ arg = @__pointer($arg)
@_SYSCALL_FCNTL_ARGSTR
}
probe __dw_syscall.fcntl = kernel.function("sys_fcntl64").call ?,
kernel.function("sys32_fstat64").call ?,
kernel.function("sys_newfstat").call ?,
kernel.function("sys_oabi_fstat64").call ?,
+ kernel.function("sys_oabi_fstat64").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_fstat64").call ?,
+%)
kernel.function("compat_sys_newfstat").call ?
{
@_SYSCALL_FSTAT_NAME
@_SYSCALL_FSTAT_ARGSTR
}
probe dw_syscall.fstat.return = kernel.function("sys_fstat").return ?,
- kernel.function("sys_fstat64").return ?,
- kernel.function("sys32_fstat64").return ?,
- kernel.function("sys_newfstat").return ?,
- kernel.function("sys_oabi_fstat64").return ?,
- kernel.function("compat_sys_newfstat").return ?
+ kernel.function("sys_fstat64").return ?,
+ kernel.function("sys32_fstat64").return ?,
+ kernel.function("sys_newfstat").return ?,
+ kernel.function("sys_oabi_fstat64").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_fstat64").return ?,
+%)
+ kernel.function("compat_sys_newfstat").return ?
{
@_SYSCALL_FSTAT_NAME
retstr = return_str(1, $return)
kprobe.function("sys32_fstat64") ?,
kprobe.function("sys_newfstat") ?,
kprobe.function("sys_oabi_fstat64") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_fstat64") ?,
+%)
kprobe.function("compat_sys_newfstat") ?
{
@_SYSCALL_FSTAT_NAME
@_SYSCALL_FSTAT_ARGSTR
}
probe nd_syscall.fstat.return = kprobe.function("sys_fstat").return ?,
- kprobe.function("sys_fstat64").return ?,
- kprobe.function("sys32_fstat64").return ?,
- kprobe.function("sys_newfstat").return ?,
- kprobe.function("sys_oabi_fstat64").return ?,
- kprobe.function("compat_sys_newfstat").return ?
+ kprobe.function("sys_fstat64").return ?,
+ kprobe.function("sys32_fstat64").return ?,
+ kprobe.function("sys_newfstat").return ?,
+ kprobe.function("sys_oabi_fstat64").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_fstat64").return ?,
+%)
+ kprobe.function("compat_sys_newfstat").return ?
{
@_SYSCALL_FSTAT_NAME
retstr = returnstr(1)
kernel.function("sys_newfstatat").call ?,
kernel.function("compat_sys_newfstatat").call ?,
kernel.function("sys32_fstatat64").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_fstatat64").call ?,
+%)
kernel.function("sys32_fstatat").call ?
{
@_SYSCALL_FSTATAT_NAME
@_SYSCALL_FSTATAT_ARGSTR
}
probe dw_syscall.fstatat.return = kernel.function("sys_fstatat64").return ?,
- kernel.function("sys_newfstatat").return ?,
- kernel.function("compat_sys_newfstatat").return ?,
- kernel.function("sys32_fstatat64").return ?,
- kernel.function("sys32_fstatat").return ?
+ kernel.function("sys_newfstatat").return ?,
+ kernel.function("compat_sys_newfstatat").return ?,
+ kernel.function("sys32_fstatat64").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_fstatat64").return ?,
+%)
+ kernel.function("sys32_fstatat").return ?
{
@_SYSCALL_FSTATAT_NAME
retstr = return_str(1, $return)
kprobe.function("sys_newfstatat") ?,
kprobe.function("compat_sys_newfstatat") ?,
kprobe.function("sys32_fstatat64") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_fstatat64") ?,
+%)
kprobe.function("sys32_fstatat") ?
{
@_SYSCALL_FSTATAT_NAME
@_SYSCALL_FSTATAT_ARGSTR
}
probe nd_syscall.fstatat.return = kprobe.function("sys_fstatat64").return ?,
- kprobe.function("sys_newfstatat").return ?,
- kprobe.function("compat_sys_newfstatat").return ?,
- kprobe.function("sys32_fstatat64").return ?,
- kprobe.function("sys32_fstatat").return ?
+ kprobe.function("sys_newfstatat").return ?,
+ kprobe.function("compat_sys_newfstatat").return ?,
+ kprobe.function("sys32_fstatat64").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_fstatat64").return ?,
+%)
+ kprobe.function("sys32_fstatat").return ?
{
@_SYSCALL_FSTATAT_NAME
retstr = returnstr(1)
@_SYSCALL_FSTATFS64_NAME
fd = __int32($fd)
sz = __ulong($sz)
- buf_uaddr = $buf
+ buf_uaddr = @__pointer($buf)
@_SYSCALL_FSTATFS64_ARGSTR
}
probe dw_syscall.fstatfs64.return = kernel.function("sys_fstatfs64").return ?,
futex_uaddr = @__pointer($uaddr)
op = __int32($op)
val = __int32($val)
- utime_uaddr = $utime
+ utime_uaddr = @__pointer($utime)
uaddr2_uaddr = $uaddr2
val3 = __int32($val3)
@__futex_argstr(futex_uaddr, op, val, utime_uaddr, uaddr2_uaddr, val3)
@_SYSCALL_FUTIMESAT_NAME
dirfd = __int32($dfd)
dirfd_str = _dfd_str(__int32($dfd))
- filename_uaddr = $filename
+ filename_uaddr = @__pointer($filename)
filename = user_string_quoted($filename)
- tvp_uaddr = $t
+ tvp_uaddr = @__pointer($t)
tvp_str = _struct_compat_timeval_u(tvp_uaddr, 2)
@_SYSCALL_FUTIMESAT_ARGSTR
}
probe dw_syscall.getegid = kernel.function("sys_getegid16").call ?,
kernel.function("sys32_getegid16").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getegid16").call ?,
+%)
kernel.function("sys_getegid").call
{
@_SYSCALL_GETEGID_NAME
@_SYSCALL_GETEGID_ARGSTR
}
probe dw_syscall.getegid.return = kernel.function("sys_getegid16").return ?,
- kernel.function("sys32_getegid16").return ?,
- kernel.function("sys_getegid").return
+ kernel.function("sys32_getegid16").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getegid16").return ?,
+%)
+ kernel.function("sys_getegid").return
{
@_SYSCALL_GETEGID_NAME
retstr = return_str(1, $return)
probe nd_syscall.getegid = kprobe.function("sys_getegid16") ?,
kprobe.function("sys32_getegid16") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getegid16") ?,
+%)
kprobe.function("sys_getegid")
{
@_SYSCALL_GETEGID_NAME
@_SYSCALL_GETEGID_ARGSTR
}
probe nd_syscall.getegid.return = kprobe.function("sys_getegid16").return ?,
- kprobe.function("sys32_getegid16").return ?,
- kprobe.function("sys_getegid").return
+ kprobe.function("sys32_getegid16").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getegid16").return ?,
+%)
+ kprobe.function("sys_getegid").return
{
@_SYSCALL_GETEGID_NAME
retstr = returnstr(1)
probe dw_syscall.geteuid = kernel.function("sys_geteuid16").call ?,
kernel.function("sys32_geteuid16").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_geteuid16").call ?,
+%)
kernel.function("sys_geteuid").call
{
@_SYSCALL_GETEUID_NAME
@_SYSCALL_GETEUID_ARGSTR
}
probe dw_syscall.geteuid.return = kernel.function("sys_geteuid16").return ?,
- kernel.function("sys32_geteuid16").return ?,
- kernel.function("sys_geteuid").return
+ kernel.function("sys32_geteuid16").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_geteuid16").return ?,
+%)
+ kernel.function("sys_geteuid").return
{
@_SYSCALL_GETEUID_NAME
retstr = return_str(1, $return)
probe nd_syscall.geteuid = kprobe.function("sys_geteuid16") ?,
kprobe.function("sys32_geteuid16") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_geteuid16") ?,
+%)
kprobe.function("sys_geteuid")
{
@_SYSCALL_GETEUID_NAME
@_SYSCALL_GETEUID_ARGSTR
}
probe nd_syscall.geteuid.return = kprobe.function("sys_geteuid16").return ?,
- kprobe.function("sys32_geteuid16").return ?,
- kprobe.function("sys_geteuid").return
+ kprobe.function("sys32_geteuid16").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_geteuid16").return ?,
+%)
+ kprobe.function("sys_geteuid").return
{
@_SYSCALL_GETEUID_NAME
retstr = returnstr(1)
probe dw_syscall.getgid = kernel.function("sys_getgid16").call ?,
kernel.function("sys32_getgid16").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getgid16").call ?,
+%)
kernel.function("sys_getgid").call
{
@_SYSCALL_GETGID_NAME
@_SYSCALL_GETGID_ARGSTR
}
probe dw_syscall.getgid.return = kernel.function("sys_getgid16").return ?,
- kernel.function("sys32_getgid16").return ?,
- kernel.function("sys_getgid").return
+ kernel.function("sys32_getgid16").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getgid16").return ?,
+%)
+ kernel.function("sys_getgid").return
{
@_SYSCALL_GETGID_NAME
retstr = return_str(1, $return)
probe nd_syscall.getgid = kprobe.function("sys_getgid16") ?,
kprobe.function("sys32_getgid16") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getgid16") ?,
+%)
kprobe.function("sys_getgid")
{
@_SYSCALL_GETGID_NAME
@_SYSCALL_GETGID_ARGSTR
}
probe nd_syscall.getgid.return = kprobe.function("sys_getgid16").return ?,
- kprobe.function("sys32_getgid16").return ?,
- kprobe.function("sys_getgid").return
+ kprobe.function("sys32_getgid16").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getgid16").return ?,
+%)
+ kprobe.function("sys_getgid").return
{
@_SYSCALL_GETGID_NAME
retstr = returnstr(1)
# dw_getgroups _____________________________________________________
probe dw_syscall.getgroups = kernel.function("sys_getgroups16").call ?,
- kernel.function("sys32_getgroups16").call ?,
- kernel.function("sys_getgroups").call ?
+ kernel.function("sys32_getgroups16").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getgroups16").call ?,
+%)
+ kernel.function("sys_getgroups").call ?
{
@_SYSCALL_GETGROUPS_NAME
size = __int32($gidsetsize)
list_uaddr = $grouplist
@_SYSCALL_GETGROUPS_ARGSTR
}
-probe dw_syscall.getgroups.return = kernel.function("sys_getgroups16").return ?,
- kernel.function("sys32_getgroups16").return ?,
- kernel.function("sys_getgroups").return ?
+probe dw_syscall.getgroups.return =
+ kernel.function("sys_getgroups16").return ?,
+ kernel.function("sys32_getgroups16").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getgroups16").return ?,
+%)
+ kernel.function("sys_getgroups").return ?
{
@_SYSCALL_GETGROUPS_NAME
retstr = return_str(1, $return)
# nd_getgroups _____________________________________________________
probe nd_syscall.getgroups = kprobe.function("sys_getgroups16") ?,
- kprobe.function("sys32_getgroups16") ?,
- kprobe.function("sys_getgroups") ?
+ kprobe.function("sys32_getgroups16") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getgroups16") ?,
+%)
+ kprobe.function("sys_getgroups") ?
{
@_SYSCALL_GETGROUPS_NAME
asmlinkage()
list_uaddr = pointer_arg(2)
@_SYSCALL_GETGROUPS_ARGSTR
}
-probe nd_syscall.getgroups.return = kprobe.function("sys_getgroups16").return ?,
- kprobe.function("sys32_getgroups16").return ?,
- kprobe.function("sys_getgroups").return ?
+probe nd_syscall.getgroups.return =
+ kprobe.function("sys_getgroups16").return ?,
+ kprobe.function("sys32_getgroups16").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getgroups16").return ?,
+%)
+ kprobe.function("sys_getgroups").return ?
{
@_SYSCALL_GETGROUPS_NAME
retstr = returnstr(1)
}
probe __syscall.socketcall.getpeername = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_GETPEERNAME")) next;
+ if (__int32($call) != @const("SYS_GETPEERNAME")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
name_uaddr = user_ulong(&@cast($args, "ulong")[1])
namelen_uaddr = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.getpeername =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_GETPEERNAME")) next;
+ if (__int32($call) != @const("SYS_GETPEERNAME")) next;
s = user_int(&@cast($args, "unsigned int")[0])
name_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
namelen_uaddr = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_GETPEERNAME")) next;
+ if (__int32(@entry($call)) != @const("SYS_GETPEERNAME")) next;
}
# nd_getpeername _____________________________________________________
}
probe __syscall.socketcall.getsockname = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_GETSOCKNAME")) next;
+ if (__int32($call) != @const("SYS_GETSOCKNAME")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
name_uaddr = user_ulong(&@cast($args, "ulong")[1])
namelen_uaddr = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.getsockname =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_GETSOCKNAME")) next;
+ if (__int32($call) != @const("SYS_GETSOCKNAME")) next;
s = user_int(&@cast($args, "unsigned int")[0])
name_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
namelen_uaddr = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_GETSOCKNAME")) next;
+ if (__int32(@entry($call)) != @const("SYS_GETSOCKNAME")) next;
}
# nd_getsockname _____________________________________________________
}
probe __syscall.socketcall.getsockopt = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_GETSOCKOPT")) next;
+ if (__int32($call) != @const("SYS_GETSOCKOPT")) next;
fd = __int32(user_ulong(&@cast($args, "ulong")[0]))
level = __int32(user_ulong(&@cast($args, "ulong")[1]))
optname = __int32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.compat_socketcall.getsockopt =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_GETSOCKOPT")) next;
+ if (__int32($call) != @const("SYS_GETSOCKOPT")) next;
fd = user_int(&@cast($args, "unsigned int")[0])
level = user_int(&@cast($args, "unsigned int")[1])
optname = user_int(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_GETSOCKOPT")) next;
+ if (__int32(@entry($call)) != @const("SYS_GETSOCKOPT")) next;
}
# nd_getsockopt _____________________________________________________
probe dw_syscall.getuid = kernel.function("sys_getuid16").call ?,
kernel.function("sys32_getuid16").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getuid16").call ?,
+%)
kernel.function("sys_getuid").call
{
@_SYSCALL_GETUID_NAME
@_SYSCALL_GETUID_ARGSTR
}
probe dw_syscall.getuid.return = kernel.function("sys_getuid16").return ?,
- kernel.function("sys32_getuid16").return ?,
- kernel.function("sys_getuid").return
+ kernel.function("sys32_getuid16").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_getuid16").return ?,
+%)
+ kernel.function("sys_getuid").return
{
@_SYSCALL_GETUID_NAME
retstr = return_str(1, $return)
probe nd_syscall.getuid = kprobe.function("sys_getuid16") ?,
kprobe.function("sys32_getuid16") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getuid16") ?,
+%)
kprobe.function("sys_getuid")
{
@_SYSCALL_GETUID_NAME
@_SYSCALL_GETUID_ARGSTR
}
probe nd_syscall.getuid.return = kprobe.function("sys_getuid16").return ?,
- kprobe.function("sys32_getuid16").return ?,
- kprobe.function("sys_getuid").return
+ kprobe.function("sys32_getuid16").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_getuid16").return ?,
+%)
+ kprobe.function("sys_getuid").return
{
@_SYSCALL_GETUID_NAME
retstr = returnstr(1)
probe dw_syscall.io_cancel = kernel.function("sys_io_cancel").call
{
@_SYSCALL_IO_CANCEL_NAME
- ctx_id = __ulong($ctx_id)
+ ctx_id = @__compat_ulong($ctx_id)
iocb_uaddr = $iocb
result_uaddr = $result
@_SYSCALL_IO_CANCEL_ARGSTR
probe dw_syscall.io_destroy = kernel.function("sys_io_destroy").call
{
@_SYSCALL_IO_DESTROY_NAME
- ctx = __ulong($ctx)
+ ctx = @__compat_ulong($ctx)
@_SYSCALL_IO_DESTROY_ARGSTR
}
probe dw_syscall.io_destroy.return = kernel.function("sys_io_destroy").return
kernel.function("compat_sys_io_getevents").call ?
{
@_SYSCALL_IO_GETEVENTS_NAME
- ctx_id = __ulong($ctx_id)
+ ctx_id = @__compat_ulong($ctx_id)
events_uaddr = $events
timeout_uaddr = $timeout
nr = @__compat_long($nr)
kernel.function("compat_sys_io_submit").call ?
{
@_SYSCALL_IO_SUBMIT_NAME
- ctx_id = __ulong($ctx_id)
+ ctx_id = @__compat_ulong($ctx_id)
nr = @__compat_long($nr)
iocbpp_uaddr = @choose_defined($iocbpp, $iocb)
@_SYSCALL_IO_SUBMIT_ARGSTR
@_SYSCALL_IOCTL_NAME
fd = __int32($fd)
request = __int32($cmd)
- argp = @choose_defined($arg, $arg32)
+ argp = @__compat_ulong(@choose_defined($arg, $arg32))
@_SYSCALL_IOCTL_ARGSTR
}
probe __syscall.ioctl = kernel.function("sys_ioctl").call
kernel.function("compat_sys_kexec_load").call ?
{
@_SYSCALL_KEXEC_LOAD_NAME
- entry = __ulong($entry)
+ entry = @__compat_ulong($entry)
nr_segments = __ulong($nr_segments)
- segments_uaddr = $segments
- flags = __ulong($flags)
+ segments_uaddr = @__pointer($segments)
+ flags = @__compat_ulong($flags)
flags_str = _kexec_flags_str(flags)
@_SYSCALL_KEXEC_LOAD_ARGSTR
}
}
probe __syscall.socketcall.listen = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_LISTEN")) next;
+ if (__int32($call) != @const("SYS_LISTEN")) next;
sockfd = __int32(user_ulong(&@cast($args, "ulong")[0]))
backlog = __int32(user_ulong(&@cast($args, "ulong")[1]))
}
probe __syscall.compat_socketcall.listen =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_LISTEN")) next;
+ if (__int32($call) != @const("SYS_LISTEN")) next;
sockfd = user_int(&@cast($args, "unsigned int")[0])
backlog = user_int(&@cast($args, "unsigned int")[1])
}
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_LISTEN")) next;
+ if (__int32(@entry($call)) != @const("SYS_LISTEN")) next;
}
# nd_listen _____________________________________________________
# long sys_lstat64(char __user * filename, struct stat64 __user * statbuf)
# long sys_oabi_lstat64(char __user * filename,
# struct oldabi_stat64 __user * statbuf)
+# COMPAT_SYSCALL_DEFINE2(s390_lstat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf)
#
@define _SYSCALL_LSTAT_NAME
kernel.function("compat_sys_newlstat").call ?,
kernel.function("sys32_lstat64").call ?,
kernel.function("sys_lstat64").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_lstat64").call ?,
+%)
kernel.function("sys_oabi_lstat64").call ?
{
@_SYSCALL_LSTAT_NAME
- path = user_string_quoted($filename)
- buf_uaddr = $statbuf
+ path = user_string_quoted(@__pointer($filename))
+ buf_uaddr = @__pointer($statbuf)
@_SYSCALL_LSTAT_ARGSTR
}
probe dw_syscall.lstat.return = kernel.function("sys_lstat").return ?,
- kernel.function("sys_newlstat").return ?,
- kernel.function("compat_sys_newlstat").return ?,
- kernel.function("sys32_lstat64").return ?,
- kernel.function("sys_lstat64").return ?,
- kernel.function("sys_oabi_lstat64").return ?
+ kernel.function("sys_newlstat").return ?,
+ kernel.function("compat_sys_newlstat").return ?,
+ kernel.function("sys32_lstat64").return ?,
+ kernel.function("sys_lstat64").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_lstat64").return ?,
+%)
+ kernel.function("sys_oabi_lstat64").return ?
{
@_SYSCALL_LSTAT_NAME
retstr = return_str(1, $return)
kprobe.function("compat_sys_newlstat") ?,
kprobe.function("sys32_lstat64") ?,
kprobe.function("sys_lstat64") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_lstat64") ?,
+%)
kprobe.function("sys_oabi_lstat64") ?
{
@_SYSCALL_LSTAT_NAME
@_SYSCALL_LSTAT_ARGSTR
}
probe nd_syscall.lstat.return = kprobe.function("sys_lstat").return ?,
- kprobe.function("sys_newlstat").return ?,
- kprobe.function("compat_sys_newlstat").return ?,
- kprobe.function("sys32_lstat64").return ?,
- kprobe.function("sys_lstat64").return ?,
- kprobe.function("sys_oabi_lstat64").return ?
+ kprobe.function("sys_newlstat").return ?,
+ kprobe.function("compat_sys_newlstat").return ?,
+ kprobe.function("sys32_lstat64").return ?,
+ kprobe.function("sys_lstat64").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_lstat64").return ?,
+%)
+ kprobe.function("sys_oabi_lstat64").return ?
{
@_SYSCALL_LSTAT_NAME
retstr = returnstr(1)
kernel.function("sys_mount").call
{
@_SYSCALL_MOUNT_NAME
- source = user_string_quoted($dev_name)
- target = user_string_quoted($dir_name)
- filesystemtype = user_string_quoted($type)
- mountflags = $flags
- mountflags_str = _mountflags_str($flags)
- data = user_string_n_quoted($data, syscall_string_trunc)
+ source = user_string_quoted(@__pointer($dev_name))
+ target = user_string_quoted(@__pointer($dir_name))
+ filesystemtype = user_string_quoted(@__pointer($type))
+ mountflags = @__compat_ulong($flags)
+ mountflags_str = _mountflags_str(mountflags)
+ data = user_string_n_quoted(@__pointer($data), syscall_string_trunc)
@_SYSCALL_MOUNT_ARGSTR
}
probe dw_syscall.mount.return = kernel.function("compat_sys_mount").return ?,
{
@_SYSCALL_MQ_GETSETATTR_NAME
mqdes = __int32($mqdes)
- u_mqstat_uaddr = $u_mqstat
- u_omqstat_uaddr = $u_omqstat
+ u_mqstat_uaddr = @__pointer($u_mqstat)
+ u_omqstat_uaddr = @__pointer($u_omqstat)
@_SYSCALL_MQ_GETSETATTR_ARGSTR
}
probe __syscall.mq_getsetattr = kernel.function("sys_mq_getsetattr").call
{
@_SYSCALL_MQ_NOTIFY_NAME
mqdes = __int32($mqdes)
- notification_uaddr = $u_notification
+ notification_uaddr = @__pointer($u_notification)
@_SYSCALL_MQ_NOTIFY_ARGSTR
}
probe __syscall.mq_notify = kernel.function("sys_mq_notify").call
kernel.function("compat_sys_mq_open").call ?
{
@_SYSCALL_MQ_OPEN_NAME
- name_uaddr = $u_name
- filename = user_string_quoted($u_name)
- u_attr_uaddr = $u_attr
+ name_uaddr = @__pointer($u_name)
+ filename = user_string_quoted(name_uaddr)
+ u_attr_uaddr = @__pointer($u_attr)
oflag = __int32($oflag)
oflag_str = _sys_open_flag_str(oflag)
mode = (@__compat_task ? __ushort($mode) : __uint32($mode))
{
@_SYSCALL_MQ_TIMEDRECEIVE_NAME
mqdes = __int32($mqdes)
- msg_ptr_uaddr = $u_msg_ptr
- msg_prio_uaddr = $u_msg_prio
- abs_timeout_uaddr = $u_abs_timeout
+ msg_ptr_uaddr = @__pointer($u_msg_ptr)
+ msg_prio_uaddr = @__pointer($u_msg_prio)
+ abs_timeout_uaddr = @__pointer($u_abs_timeout)
%( CONFIG_64BIT == "y" %?
msg_len = @__compat_ulong($msg_len)
%:
{
@_SYSCALL_MQ_TIMEDSEND_NAME
mqdes = __int32($mqdes)
- msg_ptr_uaddr = $u_msg_ptr
+ msg_ptr_uaddr = @__pointer($u_msg_ptr)
msg_prio = __uint32($msg_prio)
- abs_timeout_uaddr = $u_abs_timeout
+ abs_timeout_uaddr = @__pointer($u_abs_timeout)
%( CONFIG_64BIT == "y" %?
msg_len = @__compat_ulong($msg_len)
%:
probe dw_syscall.compat_nanosleep = kernel.function("compat_sys_nanosleep").call ?
{
@_SYSCALL_NANOSLEEP_NAME
- req_uaddr = $rqtp
+ req_uaddr = @__pointer($rqtp)
req_str = _struct_compat_timespec_u(req_uaddr, 1)
- rem_uaddr = $rmtp
+ rem_uaddr = @__pointer($rmtp)
@_SYSCALL_NANOSLEEP_ARGSTR
}
probe dw_syscall.compat_nanosleep.return = kernel.function("compat_sys_nanosleep").return ?
probe dw_syscall.compat_ppoll = kernel.function("compat_sys_ppoll").call ?
{
@_SYSCALL_PPOLL_NAME
- fds_uaddr = $ufds
+ fds_uaddr = @__pointer($ufds)
nfds = __uint32($nfds)
- tsp = $tsp
+ tsp = @__pointer($tsp)
tsp_str = _struct_compat_timespec_u(tsp, 1)
- sigmask = $sigmask
+ sigmask = @__pointer($sigmask)
sigsetsize = $sigsetsize
@_SYSCALL_PPOLL_ARGSTR
}
# char __user *buf,
# size_t count,
# loff_t pos)
+# COMPAT_SYSCALL_DEFINE5(s390_pread64, unsigned int, fd, char __user *, ubuf,
+# compat_size_t, count, u32, high, u32, low)
#
@define _SYSCALL_PREAD_NAME
probe dw_syscall.pread =
%( arch == "s390" %?
- __syscall.pread, __syscall.compat_pread ?
-%:
- __syscall.pread
+ __syscall.compat_pread ?,
%)
+ __syscall.pread
{
@_SYSCALL_PREAD_NAME
fd = __int32($fd)
- buf_uaddr = @choose_defined($buf, $ubuf)
- count = __ulong($count)
+ buf_uaddr = @__pointer(@choose_defined($buf, $ubuf))
+ count = @__compat_ulong($count)
@_SYSCALL_PREAD_ARGSTR
}
probe __syscall.pread = kernel.function("sys_pread64").call
offset = $pos
}
%( arch == "s390" %?
-probe __syscall.compat_pread = kernel.function("sys32_pread64").call ?
+probe __syscall.compat_pread = kernel.function("sys32_pread64").call ?,
+ kernel.function("compat_sys_s390_pread64").call ?
{
- offset = ($poshi << 32) + $poslo
+ offset = ((@choose_defined($poshi, $high) << 32)
+ + __uint32(@choose_defined($poslo, $low)))
}
%)
probe dw_syscall.pread.return =
%( arch == "s390" %?
- __syscall.pread.return, kernel.function("sys32_pread64").return ?
-%:
- __syscall.pread.return
+ kernel.function("sys32_pread64").return ?,
+ kernel.function("compat_sys_s390_pread64").return ?,
%)
+ __syscall.pread.return
{
@_SYSCALL_PREAD_NAME
retstr = return_str(1, $return)
probe nd_syscall.pread =
%( arch == "s390" %?
- __nd_syscall.pread, __nd_syscall.compat_pread ?
-%:
- __nd_syscall.pread
+ __nd_syscall.compat_pread ?,
%)
+ __nd_syscall.pread
{
@_SYSCALL_PREAD_NAME
asmlinkage()
offset = longlong_arg(4)
}
%( arch == "s390" %?
-probe __nd_syscall.compat_pread = kprobe.function("sys32_pread64").call ?
+probe __nd_syscall.compat_pread = kprobe.function("sys32_pread64") ?,
+ kprobe.function("compat_sys_s390_pread64") ?
{
asmlinkage()
offset = (u32_arg(4) << 32) + u32_arg(5)
%)
probe nd_syscall.pread.return =
%( arch == "s390" %?
- __nd_syscall.pread.return, kprobe.function("sys32_pread64").return ?
-%:
- __nd_syscall.pread.return
+ kprobe.function("sys32_pread64").return ?,
+ kprobe.function("compat_sys_s390_pread64").return ?,
%)
+ __nd_syscall.pread.return
{
@_SYSCALL_PREAD_NAME
retstr = returnstr(1)
{
@_SYSCALL_PROCESS_VM_READV_NAME
pid = __int32($pid)
- local_iov_uaddr = $lvec
+ local_iov_uaddr = @__pointer($lvec)
liovcnt = @__compat_ulong($liovcnt)
- remote_iov_uaddr = $rvec
+ remote_iov_uaddr = @__pointer($rvec)
riovcnt = @__compat_ulong($riovcnt)
flags = @__compat_ulong($flags)
@_SYSCALL_PROCESS_VM_READV_ARGSTR
{
@_SYSCALL_PROCESS_VM_WRITEV_NAME
pid = __int32($pid)
- local_iov_uaddr = $lvec
+ local_iov_uaddr = @__pointer($lvec)
liovcnt = @__compat_ulong($liovcnt)
- remote_iov_uaddr = $rvec
+ remote_iov_uaddr = @__pointer($rvec)
riovcnt = @__compat_ulong($riovcnt)
flags = @__compat_ulong($flags)
@_SYSCALL_PROCESS_VM_WRITEV_ARGSTR
{
@_SYSCALL_PSELECT6_NAME
nfds = __int32($n)
- readfds = $inp
- writefds = $outp
- exceptfds = $exp
- timeout = $tsp
+ readfds = @__pointer($inp)
+ writefds = @__pointer($outp)
+ exceptfds = @__pointer($exp)
+ timeout = @__pointer($tsp)
timeout_str = _struct_compat_timespec_u(timeout, 1)
- sigmask = $sig
+ sigmask = @__pointer($sig)
@_SYSCALL_PSELECT6_ARGSTR
}
probe dw_syscall.compat_pselect6.return = kernel.function("compat_sys_pselect6").return ?
@__compat_syscall_gate(@const("__NR_compat_pselect7"))
@_SYSCALL_PSELECT7_NAME
nfds = __int32($n)
- readfds = $inp
- writefds = $outp
- exceptfds = $exp
- timeout = $tsp
+ readfds = @__pointer($inp)
+ writefds = @__pointer($outp)
+ exceptfds = @__pointer($exp)
+ timeout = @__pointer($tsp)
timeout_str = _struct_compat_timespec_u(timeout, 1)
sigmask = $sig
sigsetsize = $sigsetsize
kernel.function("compat_sys_ptrace").call ?
{
@_SYSCALL_PTRACE_NAME
- request = $request
+ request = @__compat_ulong($request)
pid = __int32($pid)
addr = @__compat_ulong($addr)
data = @__compat_ulong(@choose_defined($data, $cdata))
@_SYSCALL_PWRITE_NAME
fd = __int32($fd)
buf_uaddr = $buf
- count = __ulong($count)
+ count = @__compat_ulong($count)
buf_str = user_buffer_quoted(buf_uaddr, count, syscall_string_trunc)
offset = $pos
@_SYSCALL_PWRITE_ARGSTR
# long sys32_pwrite64(unsigned int fd, const char __user *ubuf,
# size_t count, u32 poshi, u32 poslo)
+# COMPAT_SYSCALL_DEFINE5(s390_pwrite64, unsigned int, fd,
+# const char __user *, ubuf,
+# compat_size_t, count, u32, high, u32, low)
probe syscall.pwrite32 = dw_syscall.pwrite32 !, nd_syscall.pwrite32 ? {}
probe syscall.pwrite32.return = dw_syscall.pwrite32.return !,
# dw_pwrite32 _____________________________________________________
-probe dw_syscall.pwrite32 = kernel.function("sys32_pwrite64").call ?
+probe dw_syscall.pwrite32 =
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_pwrite64").call ?,
+%)
+ kernel.function("sys32_pwrite64").call ?
{
@_SYSCALL_PWRITE_NAME
fd = __int32($fd)
- count = $count
- offset = ($poshi << 32) + $poslo
- buf_uaddr = @choose_defined($buf, $ubuf)
+ count = @__compat_ulong($count)
+ offset = ((@choose_defined($poshi, $high) << 32)
+ + __uint32(@choose_defined($poslo, $low)))
+ buf_uaddr = @__pointer(@choose_defined($buf, $ubuf))
buf_str = user_buffer_quoted(buf_uaddr, count, syscall_string_trunc)
@_SYSCALL_PWRITE_ARGSTR
}
-probe dw_syscall.pwrite32.return = kernel.function("sys32_pwrite64").return ?
+probe dw_syscall.pwrite32.return =
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_pwrite64").return ?,
+%)
+ kernel.function("sys32_pwrite64").return ?
{
@_SYSCALL_PWRITE_NAME
retstr = return_str(1, $return)
# nd_pwrite32 _____________________________________________________
-probe nd_syscall.pwrite32 = kprobe.function("sys32_pwrite64") ?
+probe nd_syscall.pwrite32 =
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_pwrite64") ?,
+%)
+ kprobe.function("sys32_pwrite64") ?
{
@_SYSCALL_PWRITE_NAME
asmlinkage()
offset = (u32_arg(4) << 32) + u32_arg(5)
@_SYSCALL_PWRITE_ARGSTR
}
-probe nd_syscall.pwrite32.return = kprobe.function("sys32_pwrite64").return ?
+probe nd_syscall.pwrite32.return =
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_pwrite64").return ?,
+%)
+ kprobe.function("sys32_pwrite64").return ?
{
@_SYSCALL_PWRITE_NAME
retstr = returnstr(1)
probe dw_syscall.read =
%( arch == "s390" %?
- __syscall.read, kernel.function("sys32_read").call ?
+ __syscall.read, kernel.function("sys32_read").call ?,
+ kernel.function("compat_sys_s390_read").call ?
%:
__syscall.read
%)
{
@_SYSCALL_READ_NAME
fd = __int32($fd)
- buf_uaddr = $buf
- count = __ulong($count)
+ buf_uaddr = @__pointer($buf)
+ count = @__compat_ulong($count)
@_SYSCALL_READ_ARGSTR
}
probe __syscall.read = kernel.function("sys_read").call
}
probe dw_syscall.read.return =
%( arch == "s390" %?
- __syscall.read.return, kernel.function("sys32_read").return ?
+ __syscall.read.return, kernel.function("sys32_read").return ?,
+ kernel.function("compat_sys_s390_read").return ?
%:
__syscall.read.return
%)
probe nd_syscall.read =
%( arch == "s390" %?
- __nd_syscall.read, kprobe.function("sys32_read").call ?
+ __nd_syscall.read, kprobe.function("sys32_read") ?,
+ kprobe.function("compat_sys_s390_read") ?
%:
__nd_syscall.read
%)
}
probe nd_syscall.read.return =
%( arch == "s390" %?
- __nd_syscall.read.return, kprobe.function("sys32_read").return ?
+ __nd_syscall.read.return, kprobe.function("sys32_read").return ?,
+ kprobe.function("compat_sys_s390_read").return ?
%:
__nd_syscall.read.return
%)
}
probe __syscall.socketcall.recv = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_RECV")) next;
+ if (__int32($call) != @const("SYS_RECV")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
buf_uaddr = user_ulong(&@cast($args, "ulong")[1])
len = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.recv =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_RECV")) next;
+ if (__int32($call) != @const("SYS_RECV")) next;
s = user_int(&@cast($args, "unsigned int")[0])
buf_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
len = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_RECV")) next;
+ if (__int32(@entry($call)) != @const("SYS_RECV")) next;
}
probe __syscall.recv.return = kernel.function("sys_recv").return ?
{
}
probe __syscall.socketcall.recvfrom = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_RECVFROM")) next
+ if (__int32($call) != @const("SYS_RECVFROM")) next
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
buf_uaddr = user_ulong(&@cast($args, "ulong")[1])
len = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.recvfrom =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_RECVFROM")) next
+ if (__int32($call) != @const("SYS_RECVFROM")) next
s = user_int(&@cast($args, "unsigned int")[0])
buf_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
len = user_uint32(&@cast($args, "unsigned int")[2])
probe __syscall.socketcall.return = kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_RECVFROM")) next
+ if (__int32(@entry($call)) != @const("SYS_RECVFROM")) next
}
probe __syscall.recvfrom.return = kernel.function("sys_recvfrom").return ?
{
}
probe __syscall.socketcall.recvmsg = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_RECVMSG")) next;
+ if (__int32($call) != @const("SYS_RECVMSG")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
msg_uaddr = user_ulong(&@cast($args, "ulong")[1])
flags = __uint32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.socketcall.recvmsg.return =
kernel.function("sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_RECVMSG")) next;
+ if (__int32(@entry($call)) != @const("SYS_RECVMSG")) next;
}
# nd_recvmsg _____________________________________________________
probe dw_syscall.compat_sys_recvmsg =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_RECVMSG")) next;
+ if (__int32($call) != @const("SYS_RECVMSG")) next;
@_SYSCALL_RECVMSG_NAME
s = user_int(&@cast($args, "unsigned int")[0])
msg_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
probe dw_syscall.compat_sys_recvmsg.return =
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_RECVMSG")) next;
+ if (__int32(@entry($call)) != @const("SYS_RECVMSG")) next;
@_SYSCALL_RECVMSG_NAME
retstr = return_str(1, $return)
}
@_SYSCALL_SCHED_GETAFFINITY_NAME
pid = __int32($pid)
len = __uint32($len)
- mask_uaddr = $user_mask_ptr
+ mask_uaddr = @__pointer($user_mask_ptr)
@_SYSCALL_SCHED_GETAFFINITY_ARGSTR
}
probe dw_syscall.sched_getaffinity.return =
@_SYSCALL_SCHED_SETAFFINITY_NAME
pid = __int32($pid)
len = __uint32(@choose_defined($len, 0))
- mask_uaddr = $user_mask_ptr
+ mask_uaddr = @__pointer($user_mask_ptr)
@_SYSCALL_SCHED_SETAFFINITY_ARGSTR
}
probe dw_syscall.sched_setaffinity.return =
{
@_SYSCALL_SELECT_NAME
n = __int32($n)
- readfds_uaddr = $inp
- writefds_uaddr = $outp
- exceptfds_uaddr = $exp
- timeout_uaddr = $tvp
+ readfds_uaddr = @__pointer($inp)
+ writefds_uaddr = @__pointer($outp)
+ exceptfds_uaddr = @__pointer($exp)
+ timeout_uaddr = @__pointer($tvp)
timeout_str = _struct_compat_timeval_u(timeout_uaddr, 1)
@_SYSCALL_SELECT_ARGSTR
}
}
probe __syscall.socketcall.send = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_SEND")) next;
+ if (__int32($call) != @const("SYS_SEND")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
buf_uaddr = user_ulong(&@cast($args, "ulong")[1])
len = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.send =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SEND")) next;
+ if (__int32($call) != @const("SYS_SEND")) next;
s = user_int(&@cast($args, "unsigned int")[0])
buf_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
len = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SEND")) next;
+ if (__int32(@entry($call)) != @const("SYS_SEND")) next;
}
# nd_send _____________________________________________________
probe __syscall.compat_socketcall.sendmmsg =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SENDMMSG")) next
+ if (__int32($call) != @const("SYS_SENDMMSG")) next
s = user_int(&@cast($args, "unsigned int")[0])
mmsg_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
vlen = user_uint32(&@cast($args, "unsigned int")[2])
probe __syscall.compat_socketcall.sendmmsg.return =
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SENDMMSG")) next
+ if (__int32(@entry($call)) != @const("SYS_SENDMMSG")) next
}
probe __syscall.compat_sendmmsg.return =
kernel.function("compat_sys_sendmmsg").return ?
}
probe __syscall.socketcall.sendmsg = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_SENDMSG")) next;
+ if (__int32($call) != @const("SYS_SENDMSG")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
msg_uaddr = user_ulong(&@cast($args, "ulong")[1])
flags = __uint32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.socketcall.sendmsg.return =
kernel.function("sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SENDMSG")) next;
+ if (__int32(@entry($call)) != @const("SYS_SENDMSG")) next;
}
# nd_sendmsg _____________________________________________________
probe dw_syscall.compat_sys_sendmsg =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SENDMSG")) next;
+ if (__int32($call) != @const("SYS_SENDMSG")) next;
@_SYSCALL_SENDMSG_NAME
s = user_int(&@cast($args, "unsigned int")[0])
msg_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
probe dw_syscall.compat_sys_sendmsg.return =
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SENDMSG")) next;
+ if (__int32(@entry($call)) != @const("SYS_SENDMSG")) next;
@_SYSCALL_SENDMSG_NAME
retstr = return_str(1, $return)
}
}
probe __syscall.socketcall.sendto = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_SENDTO")) next;
+ if (__int32($call) != @const("SYS_SENDTO")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
buf_uaddr = user_ulong(&@cast($args, "ulong")[1])
len = user_ulong(&@cast($args, "ulong")[2])
probe __syscall.compat_socketcall.sendto =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SENDTO")) next;
+ if (__int32($call) != @const("SYS_SENDTO")) next;
s = user_int(&@cast($args, "unsigned int")[0])
buf_uaddr = user_uint32(&@cast($args, "unsigned int")[1])
len = user_uint32(&@cast($args, "unsigned int")[2])
kernel.function("compat_sys_socketcall").return ?
{
if (@defined(@entry($call))) {
- if (@entry($call) != @const("SYS_SENDTO")) next;
+ if (__int32(@entry($call)) != @const("SYS_SENDTO")) next;
}
else {
@__syscall_gate(@const("__NR_sendto"))
probe dw_syscall.setgroups = kernel.function("sys_setgroups16").call ?,
kernel.function("sys32_setgroups16").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_setgroups16").call ?,
+%)
kernel.function("sys_setgroups").call ?
{
@_SYSCALL_SETGROUPS_NAME
@_SYSCALL_SETGROUPS_ARGSTR
}
probe dw_syscall.setgroups.return = kernel.function("sys_setgroups16").return ?,
- kernel.function("sys32_setgroups16").return ?,
- kernel.function("sys_setgroups").return ?
+ kernel.function("sys32_setgroups16").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_setgroups16").return ?,
+%)
+ kernel.function("sys_setgroups").return ?
{
@_SYSCALL_SETGROUPS_NAME
retstr = return_str(1, $return)
probe nd_syscall.setgroups = kprobe.function("sys_setgroups16") ?,
kprobe.function("sys32_setgroups16") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_setgroups16") ?,
+%)
kprobe.function("sys_setgroups") ?
{
@_SYSCALL_SETGROUPS_NAME
@_SYSCALL_SETGROUPS_ARGSTR
}
probe nd_syscall.setgroups.return = kprobe.function("sys_setgroups16").return ?,
- kprobe.function("sys32_setgroups16").return ?,
- kprobe.function("sys_setgroups").return ?
+ kprobe.function("sys32_setgroups16").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_setgroups16").return ?,
+%)
+ kprobe.function("sys_setgroups").return ?
{
@_SYSCALL_SETGROUPS_NAME
retstr = returnstr(1)
}
probe __syscall.socketcall.setsockopt = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_SETSOCKOPT")) next;
+ if (__int32($call) != @const("SYS_SETSOCKOPT")) next;
fd = __int32(user_ulong(&@cast($args, "ulong")[0]))
level = __int32(user_ulong(&@cast($args, "ulong")[1]))
optname = __int32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.compat_socketcall.setsockopt =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SETSOCKOPT")) next;
+ if (__int32($call) != @const("SYS_SETSOCKOPT")) next;
fd = user_int(&@cast($args, "unsigned int")[0])
level = user_int(&@cast($args, "unsigned int")[1])
optname = user_int(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SETSOCKOPT")) next;
+ if (__int32(@entry($call)) != @const("SYS_SETSOCKOPT")) next;
}
# nd_setsockopt _____________________________________________________
kernel.function("compat_sys_settimeofday").call ?
{
@_SYSCALL_SETTIMEOFDAY_NAME
- tv_uaddr = $tv
+ tv_uaddr = @__pointer($tv)
tv_str = _struct_compat_timeval_u(tv_uaddr, 1)
- tz_uaddr = $tz
+ tz_uaddr = @__pointer($tz)
tz_str = _struct_timezone_u(tz_uaddr)
@_SYSCALL_SETTIMEOFDAY_ARGSTR
}
}
probe __syscall.socketcall.shutdown = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_SHUTDOWN")) next;
+ if (__int32($call) != @const("SYS_SHUTDOWN")) next;
s = __int32(user_ulong(&@cast($args, "ulong")[0]))
how = __int32(user_ulong(&@cast($args, "ulong")[1]))
}
probe __syscall.compat_socketcall.shutdown =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SHUTDOWN")) next;
+ if (__int32($call) != @const("SYS_SHUTDOWN")) next;
s = user_int(&@cast($args, "unsigned int")[0])
how = user_int(&@cast($args, "unsigned int")[1])
}
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SHUTDOWN")) next;
+ if (__int32(@entry($call)) != @const("SYS_SHUTDOWN")) next;
}
# nd_shutdown _____________________________________________________
}
probe __syscall.socketcall.socket = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_SOCKET")) next;
+ if (__int32($call) != @const("SYS_SOCKET")) next;
family = __int32(user_ulong(&@cast($args, "ulong")[0]))
type = __int32(user_ulong(&@cast($args, "ulong")[1]))
protocol = __int32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.compat_socketcall.socket =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SOCKET")) next;
+ if (__int32($call) != @const("SYS_SOCKET")) next;
family = user_int(&@cast($args, "unsigned int")[0])
type = user_int(&@cast($args, "unsigned int")[1])
protocol = user_int(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SOCKET")) next;
+ if (__int32(@entry($call)) != @const("SYS_SOCKET")) next;
}
# nd_socket _____________________________________________________
}
probe __syscall.socketcall.socketpair = kernel.function("sys_socketcall").call ?
{
- if ($call != @const("SYS_SOCKETPAIR")) next;
+ if (__int32($call) != @const("SYS_SOCKETPAIR")) next;
family = __int32(user_ulong(&@cast($args, "ulong")[0]))
type = __int32(user_ulong(&@cast($args, "ulong")[1]))
protocol = __int32(user_ulong(&@cast($args, "ulong")[2]))
probe __syscall.compat_socketcall.socketpair =
kernel.function("compat_sys_socketcall").call ?
{
- if ($call != @const("SYS_SOCKETPAIR")) next;
+ if (__int32($call) != @const("SYS_SOCKETPAIR")) next;
family = user_int(&@cast($args, "unsigned int")[0])
type = user_int(&@cast($args, "unsigned int")[1])
protocol = user_int(&@cast($args, "unsigned int")[2])
kernel.function("sys_socketcall").return ?,
kernel.function("compat_sys_socketcall").return ?
{
- if (@entry($call) != @const("SYS_SOCKETPAIR")) next;
+ if (__int32(@entry($call)) != @const("SYS_SOCKETPAIR")) next;
}
# nd_socketpair _____________________________________________________
# long sys_stat64(char __user * filename, struct stat64 __user * statbuf)
# long sys_oabi_stat64(char __user * filename, struct oldabi_stat64 __user * statbuf)
# long compat_sys_newstat(char __user * filename, struct compat_stat __user *statbuf)
+# COMPAT_SYSCALL_DEFINE2(s390_stat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf)
+#
@define _SYSCALL_STAT_NAME
%(
kernel.function("sys32_stat64").call ?,
kernel.function("sys_stat64").call ?,
kernel.function("sys_oabi_stat64").call ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_stat64").call ?,
+%)
kernel.function("compat_sys_newstat").call ?
{
@_SYSCALL_STAT_NAME
kernel.function("sys32_stat64").return ?,
kernel.function("sys_stat64").return ?,
kernel.function("sys_oabi_stat64").return ?,
+%( arch == "s390" %?
+ kernel.function("compat_sys_s390_stat64").return ?,
+%)
kernel.function("compat_sys_newstat").return ?
{
@_SYSCALL_STAT_NAME
kprobe.function("sys32_stat64") ?,
kprobe.function("sys_stat64") ?,
kprobe.function("sys_oabi_stat64") ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_stat64") ?,
+%)
kprobe.function("compat_sys_newstat") ?
{
@_SYSCALL_STAT_NAME
@_SYSCALL_STAT_ARGSTR
}
probe nd_syscall.stat.return = kprobe.function("sys_stat").return ?,
- kprobe.function("sys_newstat").return ?,
- kprobe.function("sys32_stat64").return ?,
- kprobe.function("sys_stat64").return ?,
- kprobe.function("sys_oabi_stat64").return ?,
- kprobe.function("compat_sys_newstat").return ?
+ kprobe.function("sys_newstat").return ?,
+ kprobe.function("sys32_stat64").return ?,
+ kprobe.function("sys_stat64").return ?,
+ kprobe.function("sys_oabi_stat64").return ?,
+%( arch == "s390" %?
+ kprobe.function("compat_sys_s390_stat64").return ?,
+%)
+ kprobe.function("compat_sys_newstat").return ?
{
@_SYSCALL_STAT_NAME
retstr = returnstr(1)
kernel.function("sys_statfs").call ?
{
@_SYSCALL_STATFS_NAME
- buf_uaddr = $buf
- path = user_string_quoted(@choose_defined($pathname, $path))
+ buf_uaddr = @__pointer($buf)
+ path = user_string_quoted(@__pointer(@choose_defined($pathname, $path)))
@_SYSCALL_STATFS_ARGSTR
}
kernel.function("compat_sys_statfs64").call ?
{
@_SYSCALL_STATFS64_NAME
- path = user_string_quoted(@choose_defined($pathname, $path))
+ path = user_string_quoted(@__pointer(@choose_defined($pathname, $path)))
sz = __ulong($sz)
- buf_uaddr = $buf
+ buf_uaddr = @__pointer($buf)
@_SYSCALL_STATFS64_ARGSTR
}
probe dw_syscall.statfs64.return = kernel.function("sys_statfs64").return ?,
@_SYSCALL_TIMER_CREATE_NAME
clockid = __int32($which_clock)
clockid_str = _get_wc_str(__int32($which_clock))
- evp_uaddr = $timer_event_spec
- timerid_uaddr = $created_timer_id
+ evp_uaddr = @__pointer($timer_event_spec)
+ timerid_uaddr = @__pointer($created_timer_id)
@_SYSCALL_TIMER_CREATE_ARGSTR
}
probe __syscall.timer_create = kernel.function("sys_timer_create").call
@_SYSCALL_TIMER_SETTIME_NAME
timerid = __int32($timer_id)
flags = __int32($flags)
- value_uaddr = @choose_defined($new, $new_setting)
- ovalue_uaddr = @choose_defined($old, $old_setting)
+ value_uaddr = @__pointer(@choose_defined($new, $new_setting))
+ ovalue_uaddr = @__pointer(@choose_defined($old, $old_setting))
%( CONFIG_COMPAT == "y" %?
value_str = (@__compat_task ? _struct_compat_itimerspec_u(value_uaddr)
: _struct_itimerspec_u(value_uaddr))
kernel.function("sys_times").call ?
{
@_SYSCALL_TIMES_NAME
- buf_uaddr = $tbuf
+ buf_uaddr = @__pointer($tbuf)
buf_str = _struct_tms_u(buf_uaddr)
@_SYSCALL_TIMES_ARGSTR
}
probe dw_syscall.compat_utime = kernel.function("compat_sys_utime").call ?
{
@_SYSCALL_UTIME_NAME
- filename_uaddr = $filename
- filename = user_string_quoted($filename)
- buf_uaddr = $t
+ filename_uaddr = @__pointer($filename)
+ filename = user_string_quoted(filename_uaddr)
+ buf_uaddr = @__pointer($t)
actime = _struct_compat_utimbuf_actime(buf_uaddr)
modtime = _struct_compat_utimbuf_modtime(buf_uaddr)
@_SYSCALL_UTIME_ARGSTR
@_SYSCALL_UTIMENSAT_NAME
dfd = __int32($dfd)
dfd_str = _dfd_str(__int32($dfd))
- filename_uaddr = $filename
- filename = user_string_quoted($filename)
- tsp_uaddr = $t
+ filename_uaddr = @__pointer($filename)
+ filename = user_string_quoted(filename_uaddr)
+ tsp_uaddr = @__pointer($t)
tsp_str = _struct_compat_timespec_u(tsp_uaddr, 2)
flags = __int32($flags)
flags_str = _at_flag_str(__int32($flags))
probe dw_syscall.compat_sys_utimes = kernel.function("compat_sys_utimes").call ?
{
@_SYSCALL_UTIMES_NAME
- filename = user_string_quoted($filename)
- timeval = $t
+ filename = user_string_quoted(@__pointer($filename))
+ timeval = @__pointer($t)
tvp_uaddr_str = _struct_compat_timeval_u(timeval, 2)
@_SYSCALL_UTIMES_ARGSTR
}
probe dw_syscall.write =
%( arch == "s390" %?
- __syscall.write, kernel.function("sys32_write").call ?
+ __syscall.write, kernel.function("sys32_write").call ?,
+ kernel.function("compat_sys_s390_write").call ?
%:
__syscall.write
%)
@_SYSCALL_WRITE_NAME
fd = __int32($fd)
buf_uaddr = $buf
- count = __ulong($count)
+ count = @__compat_ulong($count)
buf_str = user_buffer_quoted(buf_uaddr, count, syscall_string_trunc)
@_SYSCALL_WRITE_ARGSTR
}
}
probe dw_syscall.write.return =
%( arch == "s390" %?
- __syscall.write.return, kernel.function("sys32_write").return ?
+ __syscall.write.return, kernel.function("sys32_write").return ?,
+ kernel.function("compat_sys_s390_write").return ?
%:
__syscall.write.return
%)
probe nd_syscall.write =
%( arch == "s390" %?
- __nd_syscall.write, kprobe.function("sys32_write").call ?
+ __nd_syscall.write, kprobe.function("sys32_write") ?,
+ kprobe.function("compat_sys_s390_write") ?
%:
__nd_syscall.write
%)
}
probe nd_syscall.write.return =
%( arch == "s390" %?
- __nd_syscall.write.return, kprobe.function("sys32_write").return ?
+ __nd_syscall.write.return, kprobe.function("sys32_write").return ?,
+ kprobe.function("compat_sys_s390_write").return ?
%:
__nd_syscall.write.return
%)
#include <string.h>
#include <inttypes.h>
+inline int __io_setup(unsigned nr_events, aio_context_t *ctx_idp)
+{
+ return syscall(__NR_io_setup, nr_events, ctx_idp);
+}
+
+inline int __io_submit(aio_context_t ctx_id, long nr, struct iocb **iocbpp)
+{
+ return syscall(__NR_io_submit, ctx_id, nr, iocbpp);
+}
+
+inline int __io_getevents(aio_context_t ctx_id, long min_nr, long nr,
+ struct io_event *events, struct timespec *timeout)
+{
+ return syscall(__NR_io_getevents, ctx_id, min_nr, nr, events, timeout);
+}
+
+inline int __io_cancel(aio_context_t ctx_id, struct iocb *iocb,
+ struct io_event *result)
+{
+ return syscall(__NR_io_cancel, ctx_id, iocb, result);
+}
+
+inline int __io_destroy(aio_context_t ctx_id)
+{
+ return syscall(__NR_io_destroy, ctx_id);
+}
int main() {
aio_context_t ctx;
// ----- test normal operation
- ret = syscall(__NR_io_setup, 128, &ctx);
+ ret = __io_setup(128, &ctx);
//staptest// io_setup (128, XXXX) = NNNN
if (ret < 0) {
perror("io_setup failed");
cb.aio_nbytes = 8;
cbs[0] = &cb;
- ret = syscall(__NR_io_submit, ctx, 1, cbs);
+ ret = __io_submit(ctx, 1, cbs);
//staptest// io_submit (NNNN, 1, XXXX) = NNNN
if (ret != 1) {
perror("io_sumbit failed");
return -1;
}
- ret = syscall(__NR_io_getevents, ctx, 1, 1, events, NULL);
+ ret = __io_getevents(ctx, 1, 1, events, NULL);
//staptest// io_getevents (NNNN, 1, 1, XXXX, NULL) = NNNN
printf("%d\n", ret);
- ret = syscall(__NR_io_destroy, ctx);
+ ret = __io_destroy(ctx);
//staptest// io_destroy (NNNN) = NNNN
if (ret < 0) {
perror("io_destroy failed");
// ----- test nasty things
- syscall(__NR_io_setup, (unsigned)-1, &ctx);
+ __io_setup((unsigned)-1, &ctx);
//staptest// io_setup (4294967295, XXXX) = NNNN
- syscall(__NR_io_setup, 1, (aio_context_t *)-1);
+ __io_setup(1, (aio_context_t *)-1);
#ifdef __s390__
//staptest// io_setup (1, 0x[7]?[f]+) = NNNN
#else
//staptest// io_setup (1, 0x[f]+) = NNNN
#endif
- syscall(__NR_io_submit, (aio_context_t)-1, 1, cbs);
+ __io_submit((aio_context_t)-1, 1, cbs);
#if __WORDSIZE == 64
//staptest// io_submit (18446744073709551615, 1, XXXX) = NNNN
#else
//staptest// io_submit (4294967295, 1, XXXX) = NNNN
#endif
- syscall(__NR_io_submit, 0, (long)-1, cbs);
+ __io_submit(0, (long)-1, cbs);
//staptest// io_submit (0, -1, XXXX) = NNNN
- syscall(__NR_io_submit, 0, 1, (struct iocb **)-1);
+ __io_submit(0, 1, (struct iocb **)-1);
#ifdef __s390__
//staptest// io_submit (0, 1, 0x[7]?[f]+) = NNNN
#else
//staptest// io_submit (0, 1, 0x[f]+) = NNNN
#endif
- syscall(__NR_io_getevents, (aio_context_t)-1, 1, 1, events, NULL);
+ __io_getevents((aio_context_t)-1, 1, 1, events, NULL);
#if __WORDSIZE == 64
//staptest// io_getevents (18446744073709551615, 1, 1, XXXX, NULL) = NNNN
#else
//staptest// io_getevents (4294967295, 1, 1, XXXX, NULL) = NNNN
#endif
- syscall(__NR_io_getevents, 0, (long)-1, 1, events, NULL);
+ __io_getevents(0, (long)-1, 1, events, NULL);
//staptest// io_getevents (0, -1, 1, XXXX, NULL) = NNNN
- syscall(__NR_io_getevents, 0, 1, (long)-1, events, NULL);
+ __io_getevents(0, 1, (long)-1, events, NULL);
//staptest// io_getevents (0, 1, -1, XXXX, NULL) = NNNN
- syscall(__NR_io_getevents, 0, 1, 1, (struct io_event *)-1, NULL);
+ __io_getevents(0, 1, 1, (struct io_event *)-1, NULL);
#ifdef __s390__
//staptest// io_getevents (0, 1, 1, 0x[7]?[f]+, NULL) = NNNN
#else
//staptest// io_getevents (0, 1, 1, 0x[f]+, NULL) = NNNN
#endif
- syscall(__NR_io_getevents, 0, 1, 1, events, (struct timespec *)-1);
+ __io_getevents(0, 1, 1, events, (struct timespec *)-1);
#ifdef __s390__
//staptest// io_getevents (0, 1, 1, XXXX, 0x[7]?[f]+) = NNNN
#else
//staptest// io_getevents (0, 1, 1, XXXX, 0x[f]+) = NNNN
#endif
- syscall(__NR_io_cancel, 1, (struct iocb *)1, (struct io_event *)1);
+ __io_cancel(1, (struct iocb *)1, (struct io_event *)1);
//staptest// io_cancel (1, 0x1, 0x1) = NNNN
- syscall(__NR_io_cancel, (aio_context_t)-1, (struct iocb *)1, (struct io_event *)1);
+ __io_cancel((aio_context_t)-1, (struct iocb *)1, (struct io_event *)1);
#if __WORDSIZE == 64
//staptest// io_cancel (18446744073709551615, 0x1, 0x1) = NNNN
#else
//staptest// io_cancel (4294967295, 0x1, 0x1) = NNNN
#endif
- syscall(__NR_io_cancel, 1, (struct iocb *)-1, (struct io_event *)1);
+ __io_cancel(1, (struct iocb *)-1, (struct io_event *)1);
#ifdef __s390__
//staptest// io_cancel (1, 0x[7]?[f]+, 0x1) = NNNN
#else
//staptest// io_cancel (1, 0x[f]+, 0x1) = NNNN
#endif
- syscall(__NR_io_cancel, 1, (struct iocb *)1, (struct io_event *)-1);
+ __io_cancel(1, (struct iocb *)1, (struct io_event *)-1);
#ifdef __s390__
//staptest// io_cancel (1, 0x1, 0x[7]?[f]+) = NNNN
#else
//staptest// io_cancel (1, 0x1, 0x[f]+) = NNNN
#endif
- ret = syscall(__NR_io_destroy, (aio_context_t)-1);
+ __io_destroy((aio_context_t)-1);
#if __WORDSIZE == 64
//staptest// io_destroy (18446744073709551615) = NNNN
#else
#endif
settimeofday(&tv, NULL);
- //staptest// settimeofday (\[NNNN.NNNN\], NULL) =
+ //staptest// settimeofday (\[NNNN.NNNN\], NULL) = NNNN
settimeofday((struct timeval *)-1, NULL);
#ifdef __s390__
copy_file_range(-1, &off_in, fd_out, &off_out, buf_size, 0);
//staptest// copy_file_range (-1, XXXX, NNNN, XXXX, 59, 0x0) = -NNNN
- copy_file_range(fd_in, (off_t*)-1, fd_out, &off_out, buf_size, 0);
+ copy_file_range(fd_in, (loff_t*)-1, fd_out, &off_out, buf_size, 0);
#ifdef __s390__
//staptest// copy_file_range (NNNN, 0x[7]?[f]+, NNNN, XXXX, 59, 0x0) = -NNNN
#else
copy_file_range(fd_in, &off_in, -1, &off_out, buf_size, 0);
//staptest// copy_file_range (NNNN, XXXX, -1, XXXX, 59, 0x0) = -NNNN
- copy_file_range(fd_in, &off_in, fd_out, (off_t*)-1, buf_size, 0);
+ copy_file_range(fd_in, &off_in, fd_out, (loff_t*)-1, buf_size, 0);
#ifdef __s390__
//staptest// copy_file_range (NNNN, XXXX, NNNN, 0x[7]?[f]+, 59, 0x0) = -NNNN
#else
//staptest// copy_file_range (NNNN, XXXX, NNNN, 0x[f]+, 59, 0x0) = -NNNN
#endif
- copy_file_range(fd_in, &off_in, fd_out, &off_out, -1, 0);
- //staptest// copy_file_range (NNNN, XXXX, NNNN, XXXX, -1, 0x0) = -NNNN
+ copy_file_range(fd_in, &off_in, fd_out, &off_out, -1L, 0);
+#if __WORDSIZE == 64
+ //staptest// copy_file_range (NNNN, XXXX, NNNN, XXXX, 18446744073709551615, 0x0) = NNNN
+#else
+ //staptest// copy_file_range (NNNN, XXXX, NNNN, XXXX, 4294967295, 0x0) = NNNN
+#endif
/* Note: flags is unused and should be set to 0, otherwise an
* error occurs. This may change if the syscall is developed. */
copy_file_range(fd_in, &off_in, fd_out, &off_out, buf_size, -1);
- //staptest// copy_file_range (NNNN, XXXX, NNNN, XXXX, 59, 0xffffffff) = -NNNN
+ //staptest// copy_file_range (NNNN, XXXX, NNNN, XXXX, 59, 0xffffffff) = NNNN
close(fd_out);
close(fd_in);
//staptest// fadvise64 (NNNN, 0, 1024, 0x[f]+) = NNNN
#endif
close(fd);
+ return 0;
}
//staptest// getgroups (NNNN, 0x[f]+) = NNNN
#endif
#endif
+ return 0;
}
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
+
#ifdef __NR_ioperm
-#include <sys/io.h>
+static inline int __ioperm(unsigned long from, unsigned long num, int turn_on)
+{
+ return syscall(__NR_ioperm, from, num, turn_on);
+}
+#endif
+
+#ifdef __NR_iopl
+static inline int __iopl(int level)
+{
+ return syscall(__NR_iopl, level);
+}
#endif
// ENOSYS expected on s390 (31-on-64) and on powerpc
int main() {
#ifdef __NR_ioperm
- syscall(__NR_ioperm, 1060, 1, 1);
+ __ioperm(1060, 1, 1);
#if defined(__powerpc__) || defined(__s390__)
//staptest// ni_syscall () = -38 (ENOSYS)
#else
//staptest// ioperm (0x424, 0x1, 0x1) = NNNN
#endif
- syscall(__NR_ioperm, (unsigned long)-1, 1, 1);
+ __ioperm((unsigned long)-1, 1, 1);
#if defined(__powerpc__) || defined(__s390__)
//staptest// ni_syscall () = -38 (ENOSYS)
#else
#endif
#endif
- syscall(__NR_ioperm, 1060, (unsigned long)-1, 1);
+ __ioperm(1060, (unsigned long)-1, 1);
#if defined(__powerpc__) || defined(__s390__)
//staptest// ni_syscall () = -38 (ENOSYS)
#else
#endif
#endif
- syscall(__NR_ioperm, 1060, 1, (int)-1);
+ __ioperm(1060, 1, -1);
#if defined(__powerpc__) || defined(__s390__)
//staptest// ni_syscall () = -38 (ENOSYS)
#else
// its args vary between those two archs. Not all are
// being addressed in the tapset.
-#define iopl(x) syscall(__NR_iopl,x)
-
- iopl(3);
+ __iopl(3);
//staptest// iopl (3) = NNNN
- iopl(-1);
+ __iopl(-1);
//staptest// iopl (4294967295) = NNNN
#endif
syscall(__NR_memfd_create, (size_t)-1, MFD_CLOEXEC|MFD_ALLOW_SEALING);
#if __WORDSIZE == 64
//staptest// [[[[memfd_create (0x[16]?[f]+, MFD_CLOEXEC|MFD_ALLOW_SEALING)!!!!ni_syscall ()]]]] = -NNNN
+#else
+#ifdef __s390__
+ //staptest// [[[[memfd_create (0x[7]?[f]+, MFD_CLOEXEC|MFD_ALLOW_SEALING)!!!!ni_syscall ()]]]] = -NNNN
#else
//staptest// [[[[memfd_create (0x[8]?[f]+, MFD_CLOEXEC|MFD_ALLOW_SEALING)!!!!ni_syscall ()]]]] = -NNNN
+#endif
#endif
syscall(__NR_memfd_create,"memfd_create1", -1);
//staptest// [[[[memfd_create ("memfd_create1", MFD_[^ ]+|XXXX)!!!!ni_syscall ()]]]] = -NNNN
#define PTRACE_SETFPREGS PT_SETFPREGS
#endif
+/* Sigh. On s390x, the user headers have the PTRACE_GETREGS and
+ * PTRACE_SINGLEBLOCK constants with the same value. The kernel only
+ * supports PTRACE_SINGLEBLOCK. Fix this. */
+#if ((defined(__s390__) || defined(__s390x__)) && defined(PTRACE_GETREGS) \
+ && defined(PTRACE_SINGLEBLOCK))
+#undef PTRACE_GETREGS
+#endif
+
static void do_child(void)
{
struct sigaction child_act;
__readdir(fd, (void *)-1, 0);
#ifdef __s390__
- //staptest// [[[[readdir (NNNN, 0x7[f]+, 0)!!!!ni_syscall ()]]]] = NNNN
+ //staptest// [[[[readdir (NNNN, 0x[7]?[f]+, 0)!!!!ni_syscall ()]]]] = NNNN
#else
//staptest// [[[[readdir (NNNN, 0x[f]+, 0)!!!!ni_syscall ()]]]] = NNNN
#endif
//staptest// [[[[sched_getattr (-1, NULL, 0, 0)!!!!ni_syscall ()]]]] = -NNNN
__sched_getattr(0, (void *)-1, 0, 0);
+#ifdef __s390__
+ //staptest// [[[[sched_getattr (0, 0x[7]?[f]+, 0, 0)!!!!ni_syscall ()]]]] = -NNNN
+#else
//staptest// [[[[sched_getattr (0, 0x[f]+, 0, 0)!!!!ni_syscall ()]]]] = -NNNN
+#endif
__sched_getattr(0, 0, -1, 0);
//staptest// [[[[sched_getattr (0, NULL, 4294967295, 0)!!!!ni_syscall ()]]]] = -NNNN
//staptest// [[[[sched_setattr (-1, NULL, 0)!!!!ni_syscall ()]]]] = -NNNN
__sched_setattr(0, (void *)-1, 0);
+#ifdef __s390__
+ //staptest// [[[[sched_setattr (0, 0x[7]?[f]+, 0)!!!!ni_syscall ()]]]] = -NNNN
+#else
//staptest// [[[[sched_setattr (0, 0x[f]+, 0)!!!!ni_syscall ()]]]] = -NNNN
+#endif
__sched_setattr(0, NULL, -1);
//staptest// [[[[sched_setattr (0, NULL, 4294967295)!!!!ni_syscall ()]]]] = -NNNN
#include <linux/signal.h>
#include <sys/ptrace.h>
+// Some versions of <linux/seccomp.h> don't define SECCOMP_SET_MODE_FILTER.
+#ifndef SECCOMP_SET_MODE_FILTER
+#define SECCOMP_SET_MODE_FILTER 1
+#endif
+
struct sock_filter filter[] = {
BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
};
int main()
{
__seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog);
- //staptest// seccomp (SECCOMP_SET_MODE_FILTER, 0x0, XXXX) = NNNN
+ //staptest// [[[[seccomp (SECCOMP_SET_MODE_FILTER, 0x0, XXXX)!!!!ni_syscall ()]]]] = NNNN
// Limit testing
__seccomp(-1, 0, NULL);
- //staptest// seccomp (0x[f]+, 0x0, 0x0) = -NNNN
+ //staptest// [[[[seccomp (0x[f]+, 0x0, 0x0)!!!!ni_syscall ()]]]] = -NNNN
__seccomp(SECCOMP_SET_MODE_FILTER, -1, NULL);
- //staptest// seccomp (SECCOMP_SET_MODE_FILTER, 0x[f]+, 0x0) = -NNNN
+ //staptest// [[[[seccomp (SECCOMP_SET_MODE_FILTER, 0x[f]+, 0x0)!!!!ni_syscall ()]]]] = -NNNN
__seccomp(SECCOMP_SET_MODE_FILTER, 0, (void *)-1);
- //staptest// seccomp (SECCOMP_SET_MODE_FILTER, 0x0, 0x[f]+) = -NNNN
+#ifdef __s390__
+ //staptest// [[[[seccomp (SECCOMP_SET_MODE_FILTER, 0x0, 0x[7]?[f]+)!!!!ni_syscall ()]]]] = -NNNN
+#else
+ //staptest// [[[[seccomp (SECCOMP_SET_MODE_FILTER, 0x0, 0x[f]+)!!!!ni_syscall ()]]]] = -NNNN
+#endif
return 0;
}
//staptest// statx (-1, "foobar", AT_SYMLINK_NOFOLLOW, AT_STATX_FORCE_SYNC, XXXX) = -NNNN (EBADF)
statx(AT_FDCWD, (const char *)-1, AT_SYMLINK_NOFOLLOW, AT_STATX_FORCE_SYNC, &stx);
+#ifdef __s390__
+ //staptest// statx (AT_FDCWD, 0x[7]?[f]+, AT_SYMLINK_NOFOLLOW, AT_STATX_FORCE_SYNC, XXXX) = -NNNN (EFAULT)
+#else
//staptest// statx (AT_FDCWD, 0x[f]+, AT_SYMLINK_NOFOLLOW, AT_STATX_FORCE_SYNC, XXXX) = -NNNN (EFAULT)
+#endif
statx(AT_FDCWD, "foobar", (unsigned)-1, AT_STATX_FORCE_SYNC, &stx);
//staptest// statx (AT_FDCWD, "foobar", AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|XXXX, AT_STATX_FORCE_SYNC, XXXX) = -NNNN (EINVAL)
statx(AT_FDCWD, "foobar", AT_SYMLINK_NOFOLLOW, (unsigned)-1, &stx);
- //staptest// statx (AT_FDCWD, "foobar", AT_SYMLINK_NOFOLLOW, 0x[f]+, XXXX) = 0
+ //staptest// statx (AT_FDCWD, "foobar", AT_SYMLINK_NOFOLLOW, 0x[f]+, XXXX) = NNNN
statx(AT_FDCWD, "foobar", AT_SYMLINK_NOFOLLOW, AT_STATX_FORCE_SYNC, (struct statx *)-1);
+#ifdef __s390__
+ //staptest// statx (AT_FDCWD, "foobar", AT_SYMLINK_NOFOLLOW, AT_STATX_FORCE_SYNC, 0x[7]?[f]+) = -NNNN (EFAULT)
+#else
//staptest// statx (AT_FDCWD, "foobar", AT_SYMLINK_NOFOLLOW, AT_STATX_FORCE_SYNC, 0x[f]+) = -NNNN (EFAULT)
+#endif
#endif
close(fd);
%)
%( arch == "x86_64" %?
- __syscall_map["ni_syscall"] = ",get_thread_area,kcmp,nfsservctl,set_thread_area,uselib,"
+ __syscall_map["ni_syscall"] = ",bpf,get_thread_area,kcmp,nfsservctl,set_thread_area,uselib,"
%)
%( arch == "arm" %?
%)
%( arch == "arm64" %?
- __syscall_map["ni_syscall"] = ",get_mempolicy,kcmp,mbind,migrate_pages,move_pages,set_mempolicy,"
+ __syscall_map["ni_syscall"] = ",bpf,get_mempolicy,kcmp,mbind,migrate_pages,move_pages,set_mempolicy,"
%)
%( arch == "powerpc" %?
- __syscall_map["ni_syscall"] = ",execveat,getrandom,kcmp,memfd_create,olduname,oldolduname,readdir,renameat2,sched_getattr,sched_setattr,sigaction,signalfd4,sigpending,sigprocmask,kexec_file_load,"
+ __syscall_map["ni_syscall"] = ",bpf,execveat,getrandom,ioperm,kcmp,memfd_create,nfsservctl,olduname,oldolduname,readdir,renameat2,sched_getattr,sched_setattr,seccomp,sigaction,signalfd4,sigpending,sigprocmask,kexec_file_load,uselib,"
%)
%( arch == "s390" %?
- __syscall_map["ni_syscall"] = ",kcmp,readdir,nfsservctl,"
+ __syscall_map["ni_syscall"] = ",bpf,get_mempolicy,ioperm,kcmp,mbind,migrate_pages,move_pages,nfsservctl,readdir,set_mempolicy,uselib,userfaultfd,"
%)
}
uselib((const char *)-1);
#ifdef __s390__
- //staptest// uselib (0x[7]?[f]+) = -NNNN
+ //staptest// [[[[uselib (0x[7]?[f]+)!!!!ni_syscall ()]]]] = -NNNN
#else
//staptest// [[[[uselib (0x[f]+) = -NNNN!!!!ni_syscall () = -NNNN (ENOSYS)]]]]
#endif
struct uffdio_api api;
fd = userfaultfd(0);
- //staptest// userfaultfd (0x0) = NNNN
+ //staptest// [[[[userfaultfd (0x0)!!!!ni_syscall ()]]]] = NNNN
// userfaulfd API sanity check
memset(&api, 0, sizeof(api));
//staptest// ioctl (NNNN, NNNN, XXXX) = NNNN
close(fd);
- //staptest// close (NNNN) = 0
+ //staptest// close (NNNN) = NNNN
fd = userfaultfd(-1);
- //staptest// userfaultfd (O_[^ ]+|XXXX) = -NNNN
+ //staptest// [[[[userfaultfd (O_[^ ]+|XXXX)!!!!ni_syscall ()]]]] = -NNNN
#endif
return 0;
}