From ea322dcc9f577ae48802142e558845512fc059f4 Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 1 Jun 2017 15:29:50 -0500 Subject: [PATCH] Update the syscall tapset for the 4.11 kernel (s390x, powerpc, aarch64). * tapset/linux/s390/aux_syscalls.stp (_arch_ptrace_argstr): Add PTRACE_SINGLEBLOCK support. * tapset/linux/sysc_pwrite.stp: Fix compat 64-bit offset logic. Use @__compat_ulong() on the appropriate values. Probe the "compat_sys_s390_SYSCALL" function for s390 compat support. * tapset/linux/s390/sysc_compat_fadvise64.stp: Ditto. * tapset/linux/s390/sysc_compat_ftruncate64.stp: Ditto. * tapset/linux/s390/sysc_compat_readahead.stp: Ditto. * tapset/linux/sysc_io_cancel.stp: Use @__compat_ulong() on the appropriate values. * tapset/linux/sysc_io_destroy.stp: Ditto. * tapset/linux/sysc_io_getevents.stp: Ditto. * tapset/linux/sysc_io_submit.stp: Ditto. * tapset/linux/sysc_ioctl.stp: Ditto. * tapset/linux/sysc_kexec_load.stp: Ditto. * tapset/linux/sysc_pread.stp: Ditto. * tapset/linux/sysc_ptrace.stp: Ditto. * tapset/linux/sysc_fstatat.stp: Probe the "compat_sys_s390_SYSCALL" function for s390 compat support. * tapset/linux/sysc_getegid.stp: Ditto. * tapset/linux/sysc_geteuid.stp: Ditto. * tapset/linux/sysc_getgid.stp: Ditto. * tapset/linux/sysc_getgroups.stp: Ditto. * tapset/linux/sysc_getuid.stp: Ditto. * tapset/linux/sysc_lstat.stp: Ditto. * tapset/linux/sysc_read.stp: Ditto. * tapset/linux/sysc_setgroups.stp: Ditto. * tapset/linux/sysc_stat.stp: Ditto. * tapset/linux/sysc_write.stp: Ditto. * tapset/linux/s390/sysc_getresgid16.stp: Ditto. * tapset/linux/s390/sysc_getresuid16.stp: Ditto. * tapset/linux/s390/sysc_compat_truncate64.stp: Ditto. * tapset/linux/sysc_clock_nanosleep.stp: Use @__pointer() on pointer values. * tapset/linux/sysc_copy_file_range.stp: Ditto. * tapset/linux/sysc_execve.stp: Ditto. * tapset/linux/sysc_fcntl.stp: Ditto. * tapset/linux/sysc_fstatfs64.stp: Ditto. * tapset/linux/sysc_futex.stp: Ditto. * tapset/linux/sysc_futimesat.stp: Ditto. * tapset/linux/sysc_mount.stp: Ditto. * tapset/linux/sysc_mq_getsetattr.stp: Ditto. * tapset/linux/sysc_mq_notify.stp: Ditto. * tapset/linux/sysc_mq_open.stp: Ditto. * tapset/linux/sysc_mq_timedreceive.stp: Ditto. * tapset/linux/sysc_mq_timedsend.stp: Ditto. * tapset/linux/sysc_nanosleep.stp: Ditto. * tapset/linux/sysc_ppoll.stp: Ditto. * tapset/linux/sysc_process_vm_readv.stp: Ditto. * tapset/linux/sysc_process_vm_writev.stp: Ditto. * tapset/linux/sysc_pselect6.stp: Ditto. * tapset/linux/sysc_pselect7.stp: Ditto. * tapset/linux/sysc_sched_getaffinity.stp: Ditto. * tapset/linux/sysc_sched_setaffinity.stp: Ditto. * tapset/linux/sysc_select.stp: Ditto. * tapset/linux/sysc_settimeofday.stp: Ditto. * tapset/linux/sysc_statfs.stp: Ditto. * tapset/linux/sysc_statfs64.stp: Ditto. * tapset/linux/sysc_timer_create.stp: Ditto. * tapset/linux/sysc_timer_settime.stp: Ditto. * tapset/linux/sysc_times.stp: Ditto. * tapset/linux/sysc_utime.stp: Ditto. * tapset/linux/sysc_utimensat.stp: Ditto. * tapset/linux/sysc_utimes.stp: Ditto. * tapset/linux/sysc_accept.stp: Make sure the 'call' socketcall() argument is treated as an 32-bit int. * tapset/linux/sysc_accept4.stp: Ditto. * tapset/linux/sysc_bind.stp: Ditto. * tapset/linux/sysc_connect.stp: Ditto. * tapset/linux/sysc_getpeername.stp: Ditto. * tapset/linux/sysc_getsockname.stp: Ditto. * tapset/linux/sysc_getsockopt.stp: Ditto. * tapset/linux/sysc_listen.stp: Ditto. * tapset/linux/sysc_recv.stp: Ditto. * tapset/linux/sysc_recvfrom.stp: Ditto. * tapset/linux/sysc_recvmsg.stp: Ditto. * tapset/linux/sysc_send.stp: Ditto. * tapset/linux/sysc_sendmmsg.stp: Ditto. * tapset/linux/sysc_sendmsg.stp: Ditto. * tapset/linux/sysc_sendto.stp: Ditto. * tapset/linux/sysc_setsockopt.stp: Ditto. * tapset/linux/sysc_shutdown.stp: Ditto. * tapset/linux/sysc_socket.stp: Ditto. * tapset/linux/sysc_socketpair.stp: Ditto. * tapset/linux/sysc_execveat.stp: Fix calling the nd_syscall 'int_arg()' function on '$flags' in dw_syscall.compat_execveat. Use @__pointer() on pointer values. * tapset/linux/aux_syscalls.stp: Initialize structure to make gcc happy. * tapset/linux/arm64/syscall_num.stp: Add "statx" syscall. * tapset/linux/s390/syscall_num.stp: Ditto. * tapset/linux/powerpc/syscall_num.stp: Add "copy_file_range" and "statx" syscalls. * testsuite/systemtap.syscall/aio.c: Updated with syscall wrappers. * testsuite/systemtap.syscall/ioperm.c: Ditto. * testsuite/systemtap.syscall/clock.c: Add a return value to the regexp. * testsuite/systemtap.syscall/copy_file_range.c: Corrected types from 'off_t' to 'loff_t'. * testsuite/systemtap.syscall/fadvise64.c: Add a "return 0" from main() so that systemtap doesn't complain about the target exiting with a non-zero exit code. * testsuite/systemtap.syscall/getgroups.c: Ditto. * testsuite/systemtap.syscall/memfd_create.c: Add s390 31-bit regex support. * testsuite/systemtap.syscall/readdir.c: Ditto. * testsuite/systemtap.syscall/sched_attr.c: Ditto. * testsuite/systemtap.syscall/stat.c: Ditto. * testsuite/systemtap.syscall/uselib.c: Ditto. * testsuite/systemtap.syscall/seccomp.c: Add s390 31-bit support and allow for the syscall to be unimplemented. * testsuite/systemtap.syscall/ptrace.c: For s390, undefine PTRACE_GETREGS if we've got PTRACE_SINGLEBLOCK (since they have the same value). * testsuite/systemtap.syscall/userfaultfd.c: Handle userfaultfd() being unimplemented. * testsuite/systemtap.syscall/tapset/syscall.stp: Updated. --- tapset/linux/arm64/syscall_num.stp | 6 +- tapset/linux/aux_syscalls.stp | 4 +- tapset/linux/powerpc/syscall_num.stp | 10 +-- tapset/linux/s390/aux_syscalls.stp | 12 ++++ tapset/linux/s390/sysc_compat_fadvise64.stp | 35 ++++++---- tapset/linux/s390/sysc_compat_ftruncate64.stp | 15 +++-- tapset/linux/s390/sysc_compat_readahead.stp | 19 ++++-- tapset/linux/s390/sysc_compat_truncate64.stp | 16 +++-- tapset/linux/s390/sysc_getresgid16.stp | 14 ++-- tapset/linux/s390/sysc_getresuid16.stp | 14 ++-- tapset/linux/s390/syscall_num.stp | 12 ++-- tapset/linux/sysc_accept.stp | 6 +- tapset/linux/sysc_accept4.stp | 6 +- tapset/linux/sysc_bind.stp | 6 +- tapset/linux/sysc_clock_nanosleep.stp | 2 +- tapset/linux/sysc_connect.stp | 6 +- tapset/linux/sysc_copy_file_range.stp | 6 +- tapset/linux/sysc_execve.stp | 6 +- tapset/linux/sysc_execveat.stp | 8 +-- tapset/linux/sysc_fcntl.stp | 2 +- tapset/linux/sysc_fstat.stp | 33 +++++++--- tapset/linux/sysc_fstatat.stp | 28 +++++--- tapset/linux/sysc_fstatfs64.stp | 2 +- tapset/linux/sysc_futex.stp | 2 +- tapset/linux/sysc_futimesat.stp | 4 +- tapset/linux/sysc_getegid.stp | 20 ++++-- tapset/linux/sysc_geteuid.stp | 20 ++++-- tapset/linux/sysc_getgid.stp | 20 ++++-- tapset/linux/sysc_getgroups.stp | 34 +++++++--- tapset/linux/sysc_getpeername.stp | 6 +- tapset/linux/sysc_getsockname.stp | 6 +- tapset/linux/sysc_getsockopt.stp | 6 +- tapset/linux/sysc_getuid.stp | 20 ++++-- tapset/linux/sysc_io_cancel.stp | 2 +- tapset/linux/sysc_io_destroy.stp | 2 +- tapset/linux/sysc_io_getevents.stp | 2 +- tapset/linux/sysc_io_submit.stp | 2 +- tapset/linux/sysc_ioctl.stp | 2 +- tapset/linux/sysc_kexec_load.stp | 6 +- tapset/linux/sysc_listen.stp | 6 +- tapset/linux/sysc_lstat.stp | 37 +++++++---- tapset/linux/sysc_mount.stp | 12 ++-- tapset/linux/sysc_mq_getsetattr.stp | 4 +- tapset/linux/sysc_mq_notify.stp | 2 +- tapset/linux/sysc_mq_open.stp | 6 +- tapset/linux/sysc_mq_timedreceive.stp | 6 +- tapset/linux/sysc_mq_timedsend.stp | 4 +- tapset/linux/sysc_nanosleep.stp | 4 +- tapset/linux/sysc_ppoll.stp | 6 +- tapset/linux/sysc_pread.stp | 37 ++++++----- tapset/linux/sysc_process_vm_readv.stp | 4 +- tapset/linux/sysc_process_vm_writev.stp | 4 +- tapset/linux/sysc_pselect6.stp | 10 +-- tapset/linux/sysc_pselect7.stp | 8 +-- tapset/linux/sysc_ptrace.stp | 2 +- tapset/linux/sysc_pwrite.stp | 36 ++++++++--- tapset/linux/sysc_read.stp | 16 +++-- tapset/linux/sysc_recv.stp | 6 +- tapset/linux/sysc_recvfrom.stp | 6 +- tapset/linux/sysc_recvmsg.stp | 8 +-- tapset/linux/sysc_sched_getaffinity.stp | 2 +- tapset/linux/sysc_sched_setaffinity.stp | 2 +- tapset/linux/sysc_select.stp | 8 +-- tapset/linux/sysc_send.stp | 6 +- tapset/linux/sysc_sendmmsg.stp | 4 +- tapset/linux/sysc_sendmsg.stp | 8 +-- tapset/linux/sysc_sendto.stp | 6 +- tapset/linux/sysc_setgroups.stp | 20 ++++-- tapset/linux/sysc_setsockopt.stp | 6 +- tapset/linux/sysc_settimeofday.stp | 4 +- tapset/linux/sysc_shutdown.stp | 6 +- tapset/linux/sysc_socket.stp | 6 +- tapset/linux/sysc_socketpair.stp | 6 +- tapset/linux/sysc_stat.stp | 24 +++++-- tapset/linux/sysc_statfs.stp | 4 +- tapset/linux/sysc_statfs64.stp | 4 +- tapset/linux/sysc_timer_create.stp | 4 +- tapset/linux/sysc_timer_settime.stp | 4 +- tapset/linux/sysc_times.stp | 2 +- tapset/linux/sysc_utime.stp | 6 +- tapset/linux/sysc_utimensat.stp | 6 +- tapset/linux/sysc_utimes.stp | 4 +- tapset/linux/sysc_write.stp | 14 ++-- testsuite/systemtap.syscall/aio.c | 64 +++++++++++++------ testsuite/systemtap.syscall/clock.c | 2 +- testsuite/systemtap.syscall/copy_file_range.c | 14 ++-- testsuite/systemtap.syscall/fadvise64.c | 1 + testsuite/systemtap.syscall/getgroups.c | 1 + testsuite/systemtap.syscall/ioperm.c | 27 +++++--- testsuite/systemtap.syscall/memfd_create.c | 4 ++ testsuite/systemtap.syscall/ptrace.c | 8 +++ testsuite/systemtap.syscall/readdir.c | 2 +- testsuite/systemtap.syscall/sched_attr.c | 8 +++ testsuite/systemtap.syscall/seccomp.c | 17 +++-- testsuite/systemtap.syscall/stat.c | 10 ++- .../systemtap.syscall/tapset/syscall.stp | 8 +-- testsuite/systemtap.syscall/uselib.c | 2 +- testsuite/systemtap.syscall/userfaultfd.c | 6 +- 98 files changed, 635 insertions(+), 341 deletions(-) diff --git a/tapset/linux/arm64/syscall_num.stp b/tapset/linux/arm64/syscall_num.stp index f9ddc0048..32267648e 100644 --- a/tapset/linux/arm64/syscall_num.stp +++ b/tapset/linux/arm64/syscall_num.stp @@ -1,7 +1,7 @@ # 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" @@ -554,6 +554,8 @@ __syscall_64_num2name[289]="pkey_alloc" __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" diff --git a/tapset/linux/aux_syscalls.stp b/tapset/linux/aux_syscalls.stp index b470ab601..3404152f3 100644 --- a/tapset/linux/aux_syscalls.stp +++ b/tapset/linux/aux_syscalls.stp @@ -3618,7 +3618,7 @@ function irqflags_str:string(f:long) @__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 { @@ -3638,7 +3638,7 @@ function irqflags_str:string(f:long) %{ /* 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 { diff --git a/tapset/linux/powerpc/syscall_num.stp b/tapset/linux/powerpc/syscall_num.stp index dc670e913..04efe4c65 100644 --- a/tapset/linux/powerpc/syscall_num.stp +++ b/tapset/linux/powerpc/syscall_num.stp @@ -2,8 +2,8 @@ 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" @@ -734,8 +734,8 @@ __syscall_32_num2name[363]="switch_endian" __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" @@ -1516,4 +1516,6 @@ __syscall_64_num2name[381]="pwritev2" __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 */ diff --git a/tapset/linux/s390/aux_syscalls.stp b/tapset/linux/s390/aux_syscalls.stp index 9df8cf5c6..a793fbebb 100644 --- a/tapset/linux/s390/aux_syscalls.stp +++ b/tapset/linux/s390/aux_syscalls.stp @@ -56,8 +56,15 @@ function _stp_compat_ptrace_area_u:string(compat_ptrace_area_uaddr:long) // 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 @@ -135,6 +142,11 @@ function _arch_ptrace_argstr(request, pid, addr, data) 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) diff --git a/tapset/linux/s390/sysc_compat_fadvise64.stp b/tapset/linux/s390/sysc_compat_fadvise64.stp index 135f310b5..a6c495a30 100644 --- a/tapset/linux/s390/sysc_compat_fadvise64.stp +++ b/tapset/linux/s390/sysc_compat_fadvise64.stp @@ -35,7 +35,8 @@ probe syscall.compat_fadvise64.return = dw_syscall.compat_fadvise64.return !, # 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) @@ -43,7 +44,7 @@ probe dw_syscall.compat_fadvise64 = kernel.function("sys32_fadvise64").call ? offset = $offset } else { - offset = (($high << 32) | $low) + offset = (($high << 32) | __uint32($low)) } len = __int32($len) advice = __int32($advise) @@ -51,7 +52,8 @@ probe dw_syscall.compat_fadvise64 = kernel.function("sys32_fadvise64").call ? @_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) @@ -59,7 +61,8 @@ probe dw_syscall.compat_fadvise64.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 @@ -79,7 +82,8 @@ probe nd_syscall.compat_fadvise64 = kprobe.function("sys32_fadvise64") ? @_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) @@ -103,18 +107,21 @@ probe syscall.compat_fadvise64_64.return = dw_syscall.compat_fadvise64_64.return # 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) @@ -122,7 +129,8 @@ probe dw_syscall.compat_fadvise64_64.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") @@ -134,7 +142,8 @@ probe nd_syscall.compat_fadvise64_64 = kprobe.function("sys32_fadvise64_64") ? @_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) diff --git a/tapset/linux/s390/sysc_compat_ftruncate64.stp b/tapset/linux/s390/sysc_compat_ftruncate64.stp index 770137a74..8a69886e7 100644 --- a/tapset/linux/s390/sysc_compat_ftruncate64.stp +++ b/tapset/linux/s390/sysc_compat_ftruncate64.stp @@ -21,15 +21,18 @@ probe syscall.compat_ftruncate64.return = dw_syscall.compat_ftruncate64.return ! # 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) @@ -37,7 +40,8 @@ probe dw_syscall.compat_ftruncate64.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 @@ -46,7 +50,8 @@ probe nd_syscall.compat_ftruncate64 = kprobe.function("sys32_ftruncate64") ? @_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) diff --git a/tapset/linux/s390/sysc_compat_readahead.stp b/tapset/linux/s390/sysc_compat_readahead.stp index ca37e980e..1aa0ce151 100644 --- a/tapset/linux/s390/sysc_compat_readahead.stp +++ b/tapset/linux/s390/sysc_compat_readahead.stp @@ -2,6 +2,8 @@ # # 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 @@ -21,15 +23,19 @@ probe syscall.compat_readahead.return = dw_syscall.compat_readahead.return !, # 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) @@ -37,7 +43,8 @@ probe dw_syscall.compat_readahead.return = kernel.function("sys32_readahead").re # 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() @@ -46,7 +53,9 @@ probe nd_syscall.compat_readahead = kprobe.function("sys32_readahead") ? 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) diff --git a/tapset/linux/s390/sysc_compat_truncate64.stp b/tapset/linux/s390/sysc_compat_truncate64.stp index eb159f49c..47c839d08 100644 --- a/tapset/linux/s390/sysc_compat_truncate64.stp +++ b/tapset/linux/s390/sysc_compat_truncate64.stp @@ -21,16 +21,18 @@ probe syscall.compat_truncate64.return = dw_syscall.compat_truncate64.return !, # 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) @@ -38,7 +40,8 @@ probe dw_syscall.compat_truncate64.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 @@ -48,7 +51,8 @@ probe nd_syscall.compat_truncate64 = kprobe.function("sys32_truncate64") ? @_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) diff --git a/tapset/linux/s390/sysc_getresgid16.stp b/tapset/linux/s390/sysc_getresgid16.stp index ce73c3333..da3615d48 100644 --- a/tapset/linux/s390/sysc_getresgid16.stp +++ b/tapset/linux/s390/sysc_getresgid16.stp @@ -21,7 +21,8 @@ probe syscall.getresgid16.return = dw_syscall.getresgid16.return !, # 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) @@ -29,7 +30,9 @@ probe dw_syscall.getresgid16 = kernel.function("sys32_getresgid16") ? 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) @@ -37,7 +40,8 @@ probe dw_syscall.getresgid16.return = kernel.function("sys32_getresgid16").retur # 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() @@ -46,7 +50,9 @@ probe nd_syscall.getresgid16 = kprobe.function("sys32_getresgid16") ? 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) diff --git a/tapset/linux/s390/sysc_getresuid16.stp b/tapset/linux/s390/sysc_getresuid16.stp index 267492aef..706919e79 100644 --- a/tapset/linux/s390/sysc_getresuid16.stp +++ b/tapset/linux/s390/sysc_getresuid16.stp @@ -18,7 +18,8 @@ probe syscall.getresuid16.return = dw_syscall.getresuid16.return !, # 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) @@ -26,7 +27,9 @@ probe dw_syscall.getresuid16 = kernel.function("sys32_getresuid16") ? 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) @@ -34,7 +37,8 @@ probe dw_syscall.getresuid16.return = kernel.function("sys32_getresuid16").retur # 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() @@ -43,7 +47,9 @@ probe nd_syscall.getresuid16 = kprobe.function("sys32_getresuid16") ? 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) diff --git a/tapset/linux/s390/syscall_num.stp b/tapset/linux/s390/syscall_num.stp index 63070d75d..237200471 100644 --- a/tapset/linux/s390/syscall_num.stp +++ b/tapset/linux/s390/syscall_num.stp @@ -1,9 +1,9 @@ # 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" @@ -720,6 +720,8 @@ __syscall_32_num2name[376]="preadv2" __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" @@ -1368,4 +1370,6 @@ __syscall_64_num2name[376]="preadv2" __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 */ diff --git a/tapset/linux/sysc_accept.stp b/tapset/linux/sysc_accept.stp index da195a0db..e114095cd 100644 --- a/tapset/linux/sysc_accept.stp +++ b/tapset/linux/sysc_accept.stp @@ -42,7 +42,7 @@ probe __syscall.accept = kernel.function("sys_accept").call } 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]) @@ -50,7 +50,7 @@ probe __syscall.socketcall.accept = kernel.function("sys_socketcall").call ? 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]) @@ -69,7 +69,7 @@ probe __syscall.socketcall.accept.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_accept4.stp b/tapset/linux/sysc_accept4.stp index b68671e30..58b31618b 100644 --- a/tapset/linux/sysc_accept4.stp +++ b/tapset/linux/sysc_accept4.stp @@ -39,7 +39,7 @@ probe __syscall.accept4 = kernel.function("sys_accept4").call } 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]) @@ -48,7 +48,7 @@ probe __syscall.socketcall.accept4 = kernel.function("sys_socketcall").call ? 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]) @@ -68,7 +68,7 @@ probe __syscall.socketcall.accept4.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_bind.stp b/tapset/linux/sysc_bind.stp index d9d9a294f..3592af728 100644 --- a/tapset/linux/sysc_bind.stp +++ b/tapset/linux/sysc_bind.stp @@ -33,7 +33,7 @@ probe __syscall.bind = kernel.function("sys_bind").call ? } 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])) @@ -41,7 +41,7 @@ probe __syscall.socketcall.bind = kernel.function("sys_socketcall").call ? 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]) @@ -60,7 +60,7 @@ probe __syscall.socketcall.bind.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_clock_nanosleep.stp b/tapset/linux/sysc_clock_nanosleep.stp index 76d691799..1b1ff0b62 100644 --- a/tapset/linux/sysc_clock_nanosleep.stp +++ b/tapset/linux/sysc_clock_nanosleep.stp @@ -98,7 +98,7 @@ probe dw_syscall.compat_clock_nanosleep = 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 diff --git a/tapset/linux/sysc_connect.stp b/tapset/linux/sysc_connect.stp index 698bd8734..7df11373a 100644 --- a/tapset/linux/sysc_connect.stp +++ b/tapset/linux/sysc_connect.stp @@ -33,7 +33,7 @@ probe __syscall.connect = kernel.function("sys_connect").call ? } 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])) @@ -41,7 +41,7 @@ probe __syscall.socketcall.connect = kernel.function("sys_socketcall").call ? 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]) @@ -60,7 +60,7 @@ probe __syscall.socketcall.connect.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_copy_file_range.stp b/tapset/linux/sysc_copy_file_range.stp index 0d5c707ad..610050628 100644 --- a/tapset/linux/sysc_copy_file_range.stp +++ b/tapset/linux/sysc_copy_file_range.stp @@ -10,7 +10,7 @@ @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) %) @@ -23,9 +23,9 @@ probe dw_syscall.copy_file_range = kernel.function("sys_copy_file_range").call ? { @_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 diff --git a/tapset/linux/sysc_execve.stp b/tapset/linux/sysc_execve.stp index 06ffe32ad..3a305b51f 100644 --- a/tapset/linux/sysc_execve.stp +++ b/tapset/linux/sysc_execve.stp @@ -58,11 +58,11 @@ probe dw_syscall.execve.return = kernel.function("sys_execve").return 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 } diff --git a/tapset/linux/sysc_execveat.stp b/tapset/linux/sysc_execveat.stp index fc04c451a..952701434 100644 --- a/tapset/linux/sysc_execveat.stp +++ b/tapset/linux/sysc_execveat.stp @@ -68,11 +68,11 @@ probe dw_syscall.compat_execveat = kernel.function("compat_sys_execveat").call ? 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 } diff --git a/tapset/linux/sysc_fcntl.stp b/tapset/linux/sysc_fcntl.stp index 3672eea3d..5d489fd4d 100644 --- a/tapset/linux/sysc_fcntl.stp +++ b/tapset/linux/sysc_fcntl.stp @@ -28,7 +28,7 @@ probe dw_syscall.fcntl = __dw_syscall.fcntl, 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 ?, diff --git a/tapset/linux/sysc_fstat.stp b/tapset/linux/sysc_fstat.stp index 6b5694b39..f9a2ba760 100644 --- a/tapset/linux/sysc_fstat.stp +++ b/tapset/linux/sysc_fstat.stp @@ -28,6 +28,10 @@ probe dw_syscall.fstat = kernel.function("sys_fstat").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 @@ -36,11 +40,14 @@ probe dw_syscall.fstat = kernel.function("sys_fstat").call ?, @_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) @@ -53,6 +60,9 @@ probe nd_syscall.fstat = kprobe.function("sys_fstat") ?, 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 @@ -62,11 +72,14 @@ probe nd_syscall.fstat = kprobe.function("sys_fstat") ?, @_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) diff --git a/tapset/linux/sysc_fstatat.stp b/tapset/linux/sysc_fstatat.stp index 3a8ac6217..a9ce88121 100644 --- a/tapset/linux/sysc_fstatat.stp +++ b/tapset/linux/sysc_fstatat.stp @@ -23,6 +23,9 @@ probe dw_syscall.fstatat = kernel.function("sys_fstatat64").call ?, 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 @@ -35,10 +38,13 @@ probe dw_syscall.fstatat = kernel.function("sys_fstatat64").call ?, @_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) @@ -50,6 +56,9 @@ probe nd_syscall.fstatat = kprobe.function("sys_fstatat64") ?, 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 @@ -63,10 +72,13 @@ probe nd_syscall.fstatat = kprobe.function("sys_fstatat64") ?, @_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) diff --git a/tapset/linux/sysc_fstatfs64.stp b/tapset/linux/sysc_fstatfs64.stp index 005176d66..a3fdcabc5 100644 --- a/tapset/linux/sysc_fstatfs64.stp +++ b/tapset/linux/sysc_fstatfs64.stp @@ -24,7 +24,7 @@ probe dw_syscall.fstatfs64 = kernel.function("sys_fstatfs64").call ?, @_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 ?, diff --git a/tapset/linux/sysc_futex.stp b/tapset/linux/sysc_futex.stp index c6ae0c694..738bea875 100644 --- a/tapset/linux/sysc_futex.stp +++ b/tapset/linux/sysc_futex.stp @@ -48,7 +48,7 @@ probe dw_syscall.compat_futex = kernel.function("compat_sys_futex").call ? 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) diff --git a/tapset/linux/sysc_futimesat.stp b/tapset/linux/sysc_futimesat.stp index 64a606ba6..89532621e 100644 --- a/tapset/linux/sysc_futimesat.stp +++ b/tapset/linux/sysc_futimesat.stp @@ -45,9 +45,9 @@ probe dw_syscall.compat_futimesat = kernel.function("compat_sys_futimesat").call @_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 } diff --git a/tapset/linux/sysc_getegid.stp b/tapset/linux/sysc_getegid.stp index ee161cefc..9ef2950e5 100644 --- a/tapset/linux/sysc_getegid.stp +++ b/tapset/linux/sysc_getegid.stp @@ -22,14 +22,20 @@ probe syscall.getegid.return = dw_syscall.getegid.return !, 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) @@ -39,14 +45,20 @@ probe dw_syscall.getegid.return = kernel.function("sys_getegid16").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) diff --git a/tapset/linux/sysc_geteuid.stp b/tapset/linux/sysc_geteuid.stp index cc9d80abd..3f7073d87 100644 --- a/tapset/linux/sysc_geteuid.stp +++ b/tapset/linux/sysc_geteuid.stp @@ -20,14 +20,20 @@ probe syscall.geteuid.return = dw_syscall.geteuid.return !, nd_syscall.geteuid.r 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) @@ -37,14 +43,20 @@ probe dw_syscall.geteuid.return = kernel.function("sys_geteuid16").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) diff --git a/tapset/linux/sysc_getgid.stp b/tapset/linux/sysc_getgid.stp index c6b10e7c8..3711dab74 100644 --- a/tapset/linux/sysc_getgid.stp +++ b/tapset/linux/sysc_getgid.stp @@ -20,14 +20,20 @@ probe syscall.getgid.return = dw_syscall.getgid.return !, nd_syscall.getgid.retu 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) @@ -37,14 +43,20 @@ probe dw_syscall.getgid.return = kernel.function("sys_getgid16").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) diff --git a/tapset/linux/sysc_getgroups.stp b/tapset/linux/sysc_getgroups.stp index f74ff23cc..07a30a182 100644 --- a/tapset/linux/sysc_getgroups.stp +++ b/tapset/linux/sysc_getgroups.stp @@ -20,17 +20,24 @@ probe syscall.getgroups.return = dw_syscall.getgroups.return !, nd_syscall.getgr # 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) @@ -39,8 +46,11 @@ probe dw_syscall.getgroups.return = kernel.function("sys_getgroups16").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() @@ -48,9 +58,13 @@ probe nd_syscall.getgroups = kprobe.function("sys_getgroups16") ?, 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) diff --git a/tapset/linux/sysc_getpeername.stp b/tapset/linux/sysc_getpeername.stp index ff745316d..e292edbb8 100644 --- a/tapset/linux/sysc_getpeername.stp +++ b/tapset/linux/sysc_getpeername.stp @@ -34,7 +34,7 @@ probe __syscall.getpeername = kernel.function("sys_getpeername").call ? } 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]) @@ -42,7 +42,7 @@ probe __syscall.socketcall.getpeername = kernel.function("sys_socketcall").call 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]) @@ -61,7 +61,7 @@ probe __syscall.socketcall.getpeername.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_getsockname.stp b/tapset/linux/sysc_getsockname.stp index 08d4b7bbf..ca406fb86 100644 --- a/tapset/linux/sysc_getsockname.stp +++ b/tapset/linux/sysc_getsockname.stp @@ -35,7 +35,7 @@ probe __syscall.getsockname = kernel.function("sys_getsockname").call ? } 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]) @@ -43,7 +43,7 @@ probe __syscall.socketcall.getsockname = kernel.function("sys_socketcall").call 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]) @@ -62,7 +62,7 @@ probe __syscall.socketcall.getsockname.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_getsockopt.stp b/tapset/linux/sysc_getsockopt.stp index 9d6fd0486..304b38d9d 100644 --- a/tapset/linux/sysc_getsockopt.stp +++ b/tapset/linux/sysc_getsockopt.stp @@ -43,7 +43,7 @@ probe __syscall.getsockopt = kernel.function("sys_getsockopt").call ? } 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])) @@ -53,7 +53,7 @@ probe __syscall.socketcall.getsockopt = kernel.function("sys_socketcall").call ? 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]) @@ -74,7 +74,7 @@ probe __syscall.socketcall.getsockopt.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_getuid.stp b/tapset/linux/sysc_getuid.stp index e69b63c2d..8c5336142 100644 --- a/tapset/linux/sysc_getuid.stp +++ b/tapset/linux/sysc_getuid.stp @@ -21,14 +21,20 @@ probe syscall.getuid.return = dw_syscall.getuid.return !, nd_syscall.getuid.retu 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) @@ -38,14 +44,20 @@ probe dw_syscall.getuid.return = kernel.function("sys_getuid16").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) diff --git a/tapset/linux/sysc_io_cancel.stp b/tapset/linux/sysc_io_cancel.stp index f6a5e6626..3e6cc38ac 100644 --- a/tapset/linux/sysc_io_cancel.stp +++ b/tapset/linux/sysc_io_cancel.stp @@ -23,7 +23,7 @@ probe syscall.io_cancel.return = dw_syscall.io_cancel.return !, nd_syscall.io_ca 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 diff --git a/tapset/linux/sysc_io_destroy.stp b/tapset/linux/sysc_io_destroy.stp index 3a1b0f13e..0cc02f3dd 100644 --- a/tapset/linux/sysc_io_destroy.stp +++ b/tapset/linux/sysc_io_destroy.stp @@ -20,7 +20,7 @@ probe syscall.io_destroy.return = dw_syscall.io_destroy.return !, 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 diff --git a/tapset/linux/sysc_io_getevents.stp b/tapset/linux/sysc_io_getevents.stp index c937b17e6..30a789d9f 100644 --- a/tapset/linux/sysc_io_getevents.stp +++ b/tapset/linux/sysc_io_getevents.stp @@ -32,7 +32,7 @@ probe dw_syscall.io_getevents = __syscall.io_getevents ?, 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) diff --git a/tapset/linux/sysc_io_submit.stp b/tapset/linux/sysc_io_submit.stp index ca0f1dc9d..cd134afaa 100644 --- a/tapset/linux/sysc_io_submit.stp +++ b/tapset/linux/sysc_io_submit.stp @@ -22,7 +22,7 @@ probe dw_syscall.io_submit = __syscall.io_submit, 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 diff --git a/tapset/linux/sysc_ioctl.stp b/tapset/linux/sysc_ioctl.stp index 3e154ceb6..68de8e94d 100644 --- a/tapset/linux/sysc_ioctl.stp +++ b/tapset/linux/sysc_ioctl.stp @@ -24,7 +24,7 @@ probe dw_syscall.ioctl = __syscall.ioctl ?, @_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 diff --git a/tapset/linux/sysc_kexec_load.stp b/tapset/linux/sysc_kexec_load.stp index 1cceacd55..7b496e106 100644 --- a/tapset/linux/sysc_kexec_load.stp +++ b/tapset/linux/sysc_kexec_load.stp @@ -29,10 +29,10 @@ probe dw_syscall.kexec_load = __syscall.kexec_load.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 } diff --git a/tapset/linux/sysc_listen.stp b/tapset/linux/sysc_listen.stp index a17db3944..85a07af67 100644 --- a/tapset/linux/sysc_listen.stp +++ b/tapset/linux/sysc_listen.stp @@ -31,14 +31,14 @@ probe __syscall.listen = kernel.function("sys_listen").call ? } 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]) } @@ -56,7 +56,7 @@ probe __syscall.socketcall.listen.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_lstat.stp b/tapset/linux/sysc_lstat.stp index ff2b97d77..c041ee79f 100644 --- a/tapset/linux/sysc_lstat.stp +++ b/tapset/linux/sysc_lstat.stp @@ -6,6 +6,7 @@ # 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 @@ -29,19 +30,25 @@ probe dw_syscall.lstat = kernel.function("sys_lstat").call ?, 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) @@ -54,6 +61,9 @@ probe nd_syscall.lstat = kprobe.function("sys_lstat") ?, 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 @@ -63,11 +73,14 @@ probe nd_syscall.lstat = kprobe.function("sys_lstat") ?, @_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) diff --git a/tapset/linux/sysc_mount.stp b/tapset/linux/sysc_mount.stp index 06672b545..96bb36d6f 100644 --- a/tapset/linux/sysc_mount.stp +++ b/tapset/linux/sysc_mount.stp @@ -30,12 +30,12 @@ probe dw_syscall.mount = kernel.function("compat_sys_mount").call ?, 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 ?, diff --git a/tapset/linux/sysc_mq_getsetattr.stp b/tapset/linux/sysc_mq_getsetattr.stp index 874631700..233eaf8bf 100644 --- a/tapset/linux/sysc_mq_getsetattr.stp +++ b/tapset/linux/sysc_mq_getsetattr.stp @@ -28,8 +28,8 @@ probe dw_syscall.mq_getsetattr = { @_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 diff --git a/tapset/linux/sysc_mq_notify.stp b/tapset/linux/sysc_mq_notify.stp index c3a91e953..ca568486b 100644 --- a/tapset/linux/sysc_mq_notify.stp +++ b/tapset/linux/sysc_mq_notify.stp @@ -25,7 +25,7 @@ probe dw_syscall.mq_notify = { @_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 diff --git a/tapset/linux/sysc_mq_open.stp b/tapset/linux/sysc_mq_open.stp index 0a395c7e2..601213fef 100644 --- a/tapset/linux/sysc_mq_open.stp +++ b/tapset/linux/sysc_mq_open.stp @@ -32,9 +32,9 @@ probe dw_syscall.mq_open = __syscall.mq_open, 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)) diff --git a/tapset/linux/sysc_mq_timedreceive.stp b/tapset/linux/sysc_mq_timedreceive.stp index 080a7e2b4..e8b8b3b61 100644 --- a/tapset/linux/sysc_mq_timedreceive.stp +++ b/tapset/linux/sysc_mq_timedreceive.stp @@ -33,9 +33,9 @@ probe dw_syscall.mq_timedreceive = { @_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) %: diff --git a/tapset/linux/sysc_mq_timedsend.stp b/tapset/linux/sysc_mq_timedsend.stp index 0d1a6a07c..9526b4857 100644 --- a/tapset/linux/sysc_mq_timedsend.stp +++ b/tapset/linux/sysc_mq_timedsend.stp @@ -34,9 +34,9 @@ probe dw_syscall.mq_timedsend = { @_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) %: diff --git a/tapset/linux/sysc_nanosleep.stp b/tapset/linux/sysc_nanosleep.stp index 7c730466e..02842d01b 100644 --- a/tapset/linux/sysc_nanosleep.stp +++ b/tapset/linux/sysc_nanosleep.stp @@ -43,9 +43,9 @@ probe dw_syscall.nanosleep.return = kernel.function("sys_nanosleep").return 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 ? diff --git a/tapset/linux/sysc_ppoll.stp b/tapset/linux/sysc_ppoll.stp index 02dd32bf9..af756978c 100644 --- a/tapset/linux/sysc_ppoll.stp +++ b/tapset/linux/sysc_ppoll.stp @@ -75,11 +75,11 @@ probe syscall.compat_ppoll.return = dw_syscall.compat_ppoll.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 } diff --git a/tapset/linux/sysc_pread.stp b/tapset/linux/sysc_pread.stp index 4bff8c554..d7c7a072b 100644 --- a/tapset/linux/sysc_pread.stp +++ b/tapset/linux/sysc_pread.stp @@ -4,6 +4,8 @@ # 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 @@ -24,15 +26,14 @@ probe syscall.pread.return = dw_syscall.pread.return !, 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 @@ -43,17 +44,19 @@ 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) @@ -69,10 +72,9 @@ probe __syscall.pread.return = kernel.function("sys_pread64").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() @@ -90,7 +92,8 @@ probe __nd_syscall.pread = kprobe.function("sys_pread64") 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) @@ -98,10 +101,10 @@ probe __nd_syscall.compat_pread = kprobe.function("sys32_pread64").call ? %) 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) diff --git a/tapset/linux/sysc_process_vm_readv.stp b/tapset/linux/sysc_process_vm_readv.stp index dfa543867..63e0a3d1a 100644 --- a/tapset/linux/sysc_process_vm_readv.stp +++ b/tapset/linux/sysc_process_vm_readv.stp @@ -35,9 +35,9 @@ probe dw_syscall.process_vm_readv = kernel.function("sys_process_vm_readv").call { @_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 diff --git a/tapset/linux/sysc_process_vm_writev.stp b/tapset/linux/sysc_process_vm_writev.stp index 05a019af1..3b3414643 100644 --- a/tapset/linux/sysc_process_vm_writev.stp +++ b/tapset/linux/sysc_process_vm_writev.stp @@ -36,9 +36,9 @@ probe dw_syscall.process_vm_writev = { @_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 diff --git a/tapset/linux/sysc_pselect6.stp b/tapset/linux/sysc_pselect6.stp index da0cd3f1d..8b77eeb75 100644 --- a/tapset/linux/sysc_pselect6.stp +++ b/tapset/linux/sysc_pselect6.stp @@ -75,12 +75,12 @@ probe dw_syscall.compat_pselect6 = kernel.function("compat_sys_pselect6").call ? { @_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 ? diff --git a/tapset/linux/sysc_pselect7.stp b/tapset/linux/sysc_pselect7.stp index 385d34980..35f7291b2 100644 --- a/tapset/linux/sysc_pselect7.stp +++ b/tapset/linux/sysc_pselect7.stp @@ -80,10 +80,10 @@ probe dw_syscall.compat_pselect7 = kernel.function("compat_sys_pselect7").call ? @__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 diff --git a/tapset/linux/sysc_ptrace.stp b/tapset/linux/sysc_ptrace.stp index bd9c24eb0..4d8967ea0 100644 --- a/tapset/linux/sysc_ptrace.stp +++ b/tapset/linux/sysc_ptrace.stp @@ -26,7 +26,7 @@ probe dw_syscall.ptrace = kernel.function("sys_ptrace").call ?, 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)) diff --git a/tapset/linux/sysc_pwrite.stp b/tapset/linux/sysc_pwrite.stp index 889087a1f..4fcf3892a 100644 --- a/tapset/linux/sysc_pwrite.stp +++ b/tapset/linux/sysc_pwrite.stp @@ -30,7 +30,7 @@ probe dw_syscall.pwrite = kernel.function("sys_pwrite64").call @_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 @@ -71,6 +71,9 @@ probe nd_syscall.pwrite.return = kprobe.function("sys_pwrite64").return ? # 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 !, @@ -78,17 +81,26 @@ 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) @@ -96,7 +108,11 @@ probe dw_syscall.pwrite32.return = kernel.function("sys32_pwrite64").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() @@ -107,7 +123,11 @@ probe nd_syscall.pwrite32 = kprobe.function("sys32_pwrite64") ? 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) diff --git a/tapset/linux/sysc_read.stp b/tapset/linux/sysc_read.stp index ab65b80dc..8215e0774 100644 --- a/tapset/linux/sysc_read.stp +++ b/tapset/linux/sysc_read.stp @@ -19,15 +19,16 @@ probe syscall.read.return = dw_syscall.read.return !, 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 @@ -38,7 +39,8 @@ 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 %) @@ -57,7 +59,8 @@ probe __syscall.read.return = kernel.function("sys_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 %) @@ -77,7 +80,8 @@ probe __nd_syscall.read = kprobe.function("sys_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 %) diff --git a/tapset/linux/sysc_recv.stp b/tapset/linux/sysc_recv.stp index 0d11cbaeb..a016c0eb5 100644 --- a/tapset/linux/sysc_recv.stp +++ b/tapset/linux/sysc_recv.stp @@ -32,7 +32,7 @@ probe dw_syscall.recv = __syscall.socketcall.recv ?, } 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]) @@ -41,7 +41,7 @@ probe __syscall.socketcall.recv = kernel.function("sys_socketcall").call ? 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]) @@ -65,7 +65,7 @@ probe __syscall.socketcall.recv.return = 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 ? { diff --git a/tapset/linux/sysc_recvfrom.stp b/tapset/linux/sysc_recvfrom.stp index a6ac0daab..bf8c9723a 100644 --- a/tapset/linux/sysc_recvfrom.stp +++ b/tapset/linux/sysc_recvfrom.stp @@ -38,7 +38,7 @@ probe dw_syscall.recvfrom = __syscall.socketcall.recvfrom ?, } 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]) @@ -49,7 +49,7 @@ probe __syscall.socketcall.recvfrom = kernel.function("sys_socketcall").call ? 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]) @@ -76,7 +76,7 @@ probe dw_syscall.recvfrom.return = __syscall.socketcall.return ?, 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 ? { diff --git a/tapset/linux/sysc_recvmsg.stp b/tapset/linux/sysc_recvmsg.stp index 2953b920b..1acde8184 100644 --- a/tapset/linux/sysc_recvmsg.stp +++ b/tapset/linux/sysc_recvmsg.stp @@ -41,7 +41,7 @@ probe __syscall.recvmsg = kernel.function("sys_recvmsg").call ? } 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])) @@ -60,7 +60,7 @@ probe __syscall.recvmsg.return = kernel.function("sys_recvmsg").return ? 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 _____________________________________________________ @@ -139,7 +139,7 @@ probe syscall.compat_sys_recvmsg.return = dw_syscall.compat_sys_recvmsg.return ! 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]) @@ -150,7 +150,7 @@ probe dw_syscall.compat_sys_recvmsg = 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) } diff --git a/tapset/linux/sysc_sched_getaffinity.stp b/tapset/linux/sysc_sched_getaffinity.stp index afbc807e8..5e66b3ac3 100644 --- a/tapset/linux/sysc_sched_getaffinity.stp +++ b/tapset/linux/sysc_sched_getaffinity.stp @@ -33,7 +33,7 @@ probe dw_syscall.sched_getaffinity = @_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 = diff --git a/tapset/linux/sysc_sched_setaffinity.stp b/tapset/linux/sysc_sched_setaffinity.stp index a0adf042a..9adca981f 100644 --- a/tapset/linux/sysc_sched_setaffinity.stp +++ b/tapset/linux/sysc_sched_setaffinity.stp @@ -28,7 +28,7 @@ probe dw_syscall.sched_setaffinity = @_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 = diff --git a/tapset/linux/sysc_select.stp b/tapset/linux/sysc_select.stp index e5fce93a6..30077481e 100644 --- a/tapset/linux/sysc_select.stp +++ b/tapset/linux/sysc_select.stp @@ -77,10 +77,10 @@ probe dw_syscall.compat_select = kernel.function("compat_sys_select").call ? { @_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 } diff --git a/tapset/linux/sysc_send.stp b/tapset/linux/sysc_send.stp index eb802a951..36442ebb8 100644 --- a/tapset/linux/sysc_send.stp +++ b/tapset/linux/sysc_send.stp @@ -40,7 +40,7 @@ probe __syscall.send = kernel.function("sys_send").call ? } 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]) @@ -49,7 +49,7 @@ probe __syscall.socketcall.send = kernel.function("sys_socketcall").call ? 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]) @@ -69,7 +69,7 @@ probe __syscall.socketcall.send.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_sendmmsg.stp b/tapset/linux/sysc_sendmmsg.stp index 42a7c1903..c99ae7da9 100644 --- a/tapset/linux/sysc_sendmmsg.stp +++ b/tapset/linux/sysc_sendmmsg.stp @@ -43,7 +43,7 @@ probe __syscall.sendmmsg = kernel.function("sys_sendmmsg").call ? 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]) @@ -77,7 +77,7 @@ probe __syscall.sendmmsg.return = kernel.function("sys_sendmmsg").return ? 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 ? diff --git a/tapset/linux/sysc_sendmsg.stp b/tapset/linux/sysc_sendmsg.stp index ee30219f6..f9beead05 100644 --- a/tapset/linux/sysc_sendmsg.stp +++ b/tapset/linux/sysc_sendmsg.stp @@ -40,7 +40,7 @@ probe __syscall.sendmsg = kernel.function("sys_sendmsg").call ? } 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])) @@ -64,7 +64,7 @@ probe __syscall.sendmsg.return = kernel.function("sys_sendmsg").return ? 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 _____________________________________________________ @@ -147,7 +147,7 @@ probe syscall.compat_sys_sendmsg.return = dw_syscall.compat_sys_sendmsg.return ! 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]) @@ -158,7 +158,7 @@ probe dw_syscall.compat_sys_sendmsg = 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) } diff --git a/tapset/linux/sysc_sendto.stp b/tapset/linux/sysc_sendto.stp index 9dc09940c..4c52834a9 100644 --- a/tapset/linux/sysc_sendto.stp +++ b/tapset/linux/sysc_sendto.stp @@ -45,7 +45,7 @@ probe __syscall.sendto = kernel.function("sys_sendto").call ? } 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]) @@ -56,7 +56,7 @@ probe __syscall.socketcall.sendto = kernel.function("sys_socketcall").call ? 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]) @@ -69,7 +69,7 @@ probe dw_syscall.sendto.return = kernel.function("sys_sendto").return ?, 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")) diff --git a/tapset/linux/sysc_setgroups.stp b/tapset/linux/sysc_setgroups.stp index 17d804161..18f62a07e 100644 --- a/tapset/linux/sysc_setgroups.stp +++ b/tapset/linux/sysc_setgroups.stp @@ -23,6 +23,9 @@ probe syscall.setgroups.return = dw_syscall.setgroups.return !, 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 @@ -31,8 +34,11 @@ probe dw_syscall.setgroups = kernel.function("sys_setgroups16").call ?, @_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) @@ -42,6 +48,9 @@ probe dw_syscall.setgroups.return = kernel.function("sys_setgroups16").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 @@ -51,8 +60,11 @@ probe nd_syscall.setgroups = kprobe.function("sys_setgroups16") ?, @_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) diff --git a/tapset/linux/sysc_setsockopt.stp b/tapset/linux/sysc_setsockopt.stp index 609f1ebd7..d0d3546a5 100644 --- a/tapset/linux/sysc_setsockopt.stp +++ b/tapset/linux/sysc_setsockopt.stp @@ -44,7 +44,7 @@ probe __syscall.setsockopt = kernel.function("sys_setsockopt").call ? } 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])) @@ -54,7 +54,7 @@ probe __syscall.socketcall.setsockopt = kernel.function("sys_socketcall").call ? 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]) @@ -76,7 +76,7 @@ probe __syscall.socketcall.setsockopt.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_settimeofday.stp b/tapset/linux/sysc_settimeofday.stp index 6daa9b769..ff0226654 100644 --- a/tapset/linux/sysc_settimeofday.stp +++ b/tapset/linux/sysc_settimeofday.stp @@ -70,9 +70,9 @@ probe dw_syscall.settimeofday32 = kernel.function("sys32_settimeofday").call ?, 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 } diff --git a/tapset/linux/sysc_shutdown.stp b/tapset/linux/sysc_shutdown.stp index 699a510da..dd95e3bdc 100644 --- a/tapset/linux/sysc_shutdown.stp +++ b/tapset/linux/sysc_shutdown.stp @@ -34,14 +34,14 @@ probe __syscall.shutdown = kernel.function("sys_shutdown").call ? } 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]) } @@ -59,7 +59,7 @@ probe __syscall.socketcall.shutdown.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_socket.stp b/tapset/linux/sysc_socket.stp index 4ee602e29..1b35e5a2e 100644 --- a/tapset/linux/sysc_socket.stp +++ b/tapset/linux/sysc_socket.stp @@ -36,7 +36,7 @@ probe __syscall.socket = kernel.function("sys_socket").call ? } 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])) @@ -44,7 +44,7 @@ probe __syscall.socketcall.socket = kernel.function("sys_socketcall").call ? 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]) @@ -63,7 +63,7 @@ probe __syscall.socketcall.socket.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_socketpair.stp b/tapset/linux/sysc_socketpair.stp index 18eb89b8a..e35a6e2cc 100644 --- a/tapset/linux/sysc_socketpair.stp +++ b/tapset/linux/sysc_socketpair.stp @@ -42,7 +42,7 @@ probe __syscall.socketpair = kernel.function("sys_socketpair").call ? } 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])) @@ -51,7 +51,7 @@ probe __syscall.socketcall.socketpair = kernel.function("sys_socketcall").call ? 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]) @@ -71,7 +71,7 @@ probe __syscall.socketcall.socketpair.return = 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 _____________________________________________________ diff --git a/tapset/linux/sysc_stat.stp b/tapset/linux/sysc_stat.stp index b9e4952fb..7e9adefc4 100644 --- a/tapset/linux/sysc_stat.stp +++ b/tapset/linux/sysc_stat.stp @@ -4,6 +4,8 @@ # 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 %( @@ -25,6 +27,9 @@ probe dw_syscall.stat = kernel.function("sys_stat").call ?, 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 @@ -38,6 +43,9 @@ probe dw_syscall.stat.return = kernel.function("sys_stat").return ?, 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 @@ -51,6 +59,9 @@ probe nd_syscall.stat = kprobe.function("sys_stat") ?, 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 @@ -61,11 +72,14 @@ probe nd_syscall.stat = kprobe.function("sys_stat") ?, @_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) diff --git a/tapset/linux/sysc_statfs.stp b/tapset/linux/sysc_statfs.stp index 74db584f1..3960d1952 100644 --- a/tapset/linux/sysc_statfs.stp +++ b/tapset/linux/sysc_statfs.stp @@ -23,8 +23,8 @@ probe dw_syscall.statfs = kernel.function("compat_sys_statfs").call ?, 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 } diff --git a/tapset/linux/sysc_statfs64.stp b/tapset/linux/sysc_statfs64.stp index ff2a88242..d9de181a5 100644 --- a/tapset/linux/sysc_statfs64.stp +++ b/tapset/linux/sysc_statfs64.stp @@ -24,9 +24,9 @@ probe dw_syscall.statfs64 = kernel.function("sys_statfs64").call ?, 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 ?, diff --git a/tapset/linux/sysc_timer_create.stp b/tapset/linux/sysc_timer_create.stp index 7d97bf19d..1d61398b2 100644 --- a/tapset/linux/sysc_timer_create.stp +++ b/tapset/linux/sysc_timer_create.stp @@ -30,8 +30,8 @@ probe dw_syscall.timer_create = __syscall.timer_create, @_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 diff --git a/tapset/linux/sysc_timer_settime.stp b/tapset/linux/sysc_timer_settime.stp index 739c423c5..d0b48992e 100644 --- a/tapset/linux/sysc_timer_settime.stp +++ b/tapset/linux/sysc_timer_settime.stp @@ -33,8 +33,8 @@ probe dw_syscall.timer_settime = __syscall.timer_settime, @_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)) diff --git a/tapset/linux/sysc_times.stp b/tapset/linux/sysc_times.stp index acd601b88..97a58619e 100644 --- a/tapset/linux/sysc_times.stp +++ b/tapset/linux/sysc_times.stp @@ -23,7 +23,7 @@ probe dw_syscall.times = kernel.function("compat_sys_times").call ?, 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 } diff --git a/tapset/linux/sysc_utime.stp b/tapset/linux/sysc_utime.stp index 53d97525d..f13ed8803 100644 --- a/tapset/linux/sysc_utime.stp +++ b/tapset/linux/sysc_utime.stp @@ -66,9 +66,9 @@ probe syscall.compat_utime.return = dw_syscall.compat_utime.return !, 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 diff --git a/tapset/linux/sysc_utimensat.stp b/tapset/linux/sysc_utimensat.stp index f540ddae5..ded3e0f31 100644 --- a/tapset/linux/sysc_utimensat.stp +++ b/tapset/linux/sysc_utimensat.stp @@ -77,9 +77,9 @@ probe dw_syscall.compat_utimensat = kernel.function("compat_sys_utimensat").call @_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)) diff --git a/tapset/linux/sysc_utimes.stp b/tapset/linux/sysc_utimes.stp index b05c9eaf7..ae9677318 100644 --- a/tapset/linux/sysc_utimes.stp +++ b/tapset/linux/sysc_utimes.stp @@ -67,8 +67,8 @@ probe syscall.compat_sys_utimes.return = dw_syscall.compat_sys_utimes.return !, 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 } diff --git a/tapset/linux/sysc_write.stp b/tapset/linux/sysc_write.stp index 2e02f5015..7bc956a61 100644 --- a/tapset/linux/sysc_write.stp +++ b/tapset/linux/sysc_write.stp @@ -22,7 +22,8 @@ probe syscall.write.return = dw_syscall.write.return !, nd_syscall.write.return 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 %) @@ -30,7 +31,7 @@ probe dw_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 } @@ -42,7 +43,8 @@ probe __syscall.write = kernel.function("sys_write").call } 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 %) @@ -61,7 +63,8 @@ probe __syscall.write.return = kernel.function("sys_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 %) @@ -82,7 +85,8 @@ probe __nd_syscall.write = kprobe.function("sys_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 %) diff --git a/testsuite/systemtap.syscall/aio.c b/testsuite/systemtap.syscall/aio.c index f23da2c7a..764d1fbb0 100644 --- a/testsuite/systemtap.syscall/aio.c +++ b/testsuite/systemtap.syscall/aio.c @@ -8,6 +8,32 @@ #include #include +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; @@ -23,7 +49,7 @@ int main() { // ----- 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"); @@ -39,18 +65,18 @@ int main() { 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"); @@ -60,85 +86,85 @@ int main() { // ----- 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 diff --git a/testsuite/systemtap.syscall/clock.c b/testsuite/systemtap.syscall/clock.c index 4c539cf4a..1ac1a62e4 100644 --- a/testsuite/systemtap.syscall/clock.c +++ b/testsuite/systemtap.syscall/clock.c @@ -47,7 +47,7 @@ int main() #endif settimeofday(&tv, NULL); - //staptest// settimeofday (\[NNNN.NNNN\], NULL) = + //staptest// settimeofday (\[NNNN.NNNN\], NULL) = NNNN settimeofday((struct timeval *)-1, NULL); #ifdef __s390__ diff --git a/testsuite/systemtap.syscall/copy_file_range.c b/testsuite/systemtap.syscall/copy_file_range.c index a0271b022..5e16f4ad9 100644 --- a/testsuite/systemtap.syscall/copy_file_range.c +++ b/testsuite/systemtap.syscall/copy_file_range.c @@ -48,7 +48,7 @@ int main () 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 @@ -58,20 +58,24 @@ int main () 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); diff --git a/testsuite/systemtap.syscall/fadvise64.c b/testsuite/systemtap.syscall/fadvise64.c index dd31740e2..6ef7cd903 100644 --- a/testsuite/systemtap.syscall/fadvise64.c +++ b/testsuite/systemtap.syscall/fadvise64.c @@ -108,4 +108,5 @@ int main() //staptest// fadvise64 (NNNN, 0, 1024, 0x[f]+) = NNNN #endif close(fd); + return 0; } diff --git a/testsuite/systemtap.syscall/getgroups.c b/testsuite/systemtap.syscall/getgroups.c index bdaca03b5..a61620185 100644 --- a/testsuite/systemtap.syscall/getgroups.c +++ b/testsuite/systemtap.syscall/getgroups.c @@ -38,4 +38,5 @@ int main() //staptest// getgroups (NNNN, 0x[f]+) = NNNN #endif #endif + return 0; } diff --git a/testsuite/systemtap.syscall/ioperm.c b/testsuite/systemtap.syscall/ioperm.c index 242ced978..9aef9c99e 100644 --- a/testsuite/systemtap.syscall/ioperm.c +++ b/testsuite/systemtap.syscall/ioperm.c @@ -3,8 +3,19 @@ #define _GNU_SOURCE #include #include + #ifdef __NR_ioperm -#include +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 @@ -12,14 +23,14 @@ 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 @@ -30,7 +41,7 @@ int main() { #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 @@ -41,7 +52,7 @@ int main() { #endif #endif - syscall(__NR_ioperm, 1060, 1, (int)-1); + __ioperm(1060, 1, -1); #if defined(__powerpc__) || defined(__s390__) //staptest// ni_syscall () = -38 (ENOSYS) #else @@ -54,12 +65,10 @@ int main() { // 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 diff --git a/testsuite/systemtap.syscall/memfd_create.c b/testsuite/systemtap.syscall/memfd_create.c index 63c69b86f..373839663 100644 --- a/testsuite/systemtap.syscall/memfd_create.c +++ b/testsuite/systemtap.syscall/memfd_create.c @@ -20,8 +20,12 @@ int main() 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 diff --git a/testsuite/systemtap.syscall/ptrace.c b/testsuite/systemtap.syscall/ptrace.c index c986f4ebe..533414799 100644 --- a/testsuite/systemtap.syscall/ptrace.c +++ b/testsuite/systemtap.syscall/ptrace.c @@ -41,6 +41,14 @@ #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; diff --git a/testsuite/systemtap.syscall/readdir.c b/testsuite/systemtap.syscall/readdir.c index f7d2d9465..fe7077e4e 100644 --- a/testsuite/systemtap.syscall/readdir.c +++ b/testsuite/systemtap.syscall/readdir.c @@ -39,7 +39,7 @@ int main() { __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 diff --git a/testsuite/systemtap.syscall/sched_attr.c b/testsuite/systemtap.syscall/sched_attr.c index 062b062d1..4683e0414 100644 --- a/testsuite/systemtap.syscall/sched_attr.c +++ b/testsuite/systemtap.syscall/sched_attr.c @@ -44,7 +44,11 @@ int main() //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 @@ -56,7 +60,11 @@ int main() //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 diff --git a/testsuite/systemtap.syscall/seccomp.c b/testsuite/systemtap.syscall/seccomp.c index 86892f4eb..c3ee20b13 100644 --- a/testsuite/systemtap.syscall/seccomp.c +++ b/testsuite/systemtap.syscall/seccomp.c @@ -12,6 +12,11 @@ #include #include +// Some versions of 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), }; @@ -29,18 +34,22 @@ static inline int __seccomp(unsigned int operation, unsigned int flags, void *ar 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; } diff --git a/testsuite/systemtap.syscall/stat.c b/testsuite/systemtap.syscall/stat.c index 762e1af1c..117852279 100644 --- a/testsuite/systemtap.syscall/stat.c +++ b/testsuite/systemtap.syscall/stat.c @@ -86,16 +86,24 @@ int main() //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); diff --git a/testsuite/systemtap.syscall/tapset/syscall.stp b/testsuite/systemtap.syscall/tapset/syscall.stp index ca778c310..ade3aeb03 100644 --- a/testsuite/systemtap.syscall/tapset/syscall.stp +++ b/testsuite/systemtap.syscall/tapset/syscall.stp @@ -56,7 +56,7 @@ probe init { %) %( 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" %? @@ -64,15 +64,15 @@ probe init { %) %( 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," %) } diff --git a/testsuite/systemtap.syscall/uselib.c b/testsuite/systemtap.syscall/uselib.c index 5830b8d01..1ed70eb18 100644 --- a/testsuite/systemtap.syscall/uselib.c +++ b/testsuite/systemtap.syscall/uselib.c @@ -22,7 +22,7 @@ int main() 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 diff --git a/testsuite/systemtap.syscall/userfaultfd.c b/testsuite/systemtap.syscall/userfaultfd.c index 946d1aead..943dcdba5 100644 --- a/testsuite/systemtap.syscall/userfaultfd.c +++ b/testsuite/systemtap.syscall/userfaultfd.c @@ -26,7 +26,7 @@ int main() 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)); @@ -36,10 +36,10 @@ int main() //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; } -- 2.43.5