diff options
Diffstat (limited to 'tapset/x86_64/nd_syscalls.stp')
-rw-r--r-- | tapset/x86_64/nd_syscalls.stp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tapset/x86_64/nd_syscalls.stp b/tapset/x86_64/nd_syscalls.stp index a8157160..80c092a8 100644 --- a/tapset/x86_64/nd_syscalls.stp +++ b/tapset/x86_64/nd_syscalls.stp @@ -98,16 +98,19 @@ probe nd_syscall.mmap = kprobe.function("sys_mmap") ? // len = $len // prot = $prot // flags = $flags - // fd = $fd + // fd = __int32($fd) // offset = $off // argstr = sprintf("%p, %d, %s, %s, %d, %d", $addr, $len, - // _mprotect_prot_str($prot), _mmap_flags($flags), $fd, $off) + // _mprotect_prot_str($prot), _mmap_flags($flags), + // __int32($fd), $off) asmlinkage() start = ulong_arg(1) len = ulong_arg(2) prot = ulong_arg(3) flags = ulong_arg(4) - fd = ulong_arg(5) + # Although the kernel gets an unsigned long fd, on the + # user-side it is a signed int. Fix this. + fd = int_arg(5) offset = ulong_arg(6) argstr = sprintf("%p, %d, %s, %s, %d, %d", start, len, _mprotect_prot_str(prot), _mmap_flags(flags), fd, offset) @@ -142,11 +145,12 @@ probe nd_syscall.mmap2 = kprobe.function("sys32_mmap2") { name = "mmap2" // argstr = sprintf("%p, %d, %s, %s, %d, %d", $addr, $len, - // _mprotect_prot_str($prot), _mmap_flags($flags), $fd, $pgoff) + // _mprotect_prot_str($prot), _mmap_flags($flags), + // __int32($fd), $pgoff) asmlinkage() argstr = sprintf("%p, %d, %s, %s, %d, %d", ulong_arg(1), ulong_arg(2), _mprotect_prot_str(ulong_arg(3)), _mmap_flags(ulong_arg(4)), - ulong_arg(5), ulong_arg(6)) + int_arg(5), ulong_arg(6)) } probe nd_syscall.mmap2.return = kprobe.function("sys32_mmap2").return { |