summaryrefslogtreecommitdiffstats
path: root/tapset/i386
diff options
context:
space:
mode:
Diffstat (limited to 'tapset/i386')
-rw-r--r--tapset/i386/nd_syscalls.stp8
-rw-r--r--tapset/i386/syscalls.stp6
2 files changed, 9 insertions, 5 deletions
diff --git a/tapset/i386/nd_syscalls.stp b/tapset/i386/nd_syscalls.stp
index 92befeb5..2b13cbd7 100644
--- a/tapset/i386/nd_syscalls.stp
+++ b/tapset/i386/nd_syscalls.stp
@@ -79,17 +79,19 @@ probe nd_syscall.mmap2 = kprobe.function("sys_mmap2") ?
// length = $len
// prot = $prot
// flags = $flags
- // fd = $fd
+ // fd = __int32($fd)
// pgoffset = $pgoff
// argstr = sprintf("%p, %d, %s, %s, %d, %d", $addr,
// $len, _mprotect_prot_str($prot), _mmap_flags($flags),
- // $fd, $pgoff)
+ // __int32($fd), $pgoff)
asmlinkage()
start = ulong_arg(1)
length = 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)
pgoffset = ulong_arg(6)
argstr = sprintf("%p, %d, %s, %s, %d, %d", start,
length, _mprotect_prot_str(prot), _mmap_flags(flags),
diff --git a/tapset/i386/syscalls.stp b/tapset/i386/syscalls.stp
index 821d77d4..2d1a282b 100644
--- a/tapset/i386/syscalls.stp
+++ b/tapset/i386/syscalls.stp
@@ -68,11 +68,13 @@ probe syscall.mmap2 = kernel.function("sys_mmap2") ?
length = $len
prot = $prot
flags = $flags
- fd = $fd
+ # Although the kernel gets an unsigned long fd, on the
+ # user-side it is a signed int. Fix this.
+ fd = __int32($fd)
pgoffset = $pgoff
argstr = sprintf("%p, %d, %s, %s, %d, %d", $addr,
$len, _mprotect_prot_str($prot), _mmap_flags($flags),
- $fd, $pgoff)
+ __int32($fd), $pgoff)
}
probe syscall.mmap2.return = kernel.function("sys_mmap2").return ?
{