summaryrefslogtreecommitdiffstats
path: root/tapset/i386/nd_syscalls.stp
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2010-02-23 15:57:25 -0600
committerDavid Smith <dsmith@redhat.com>2010-02-23 15:57:25 -0600
commitd945a07eecee9851173365459d196bcd22c3e636 (patch)
treeacf0cf964c937f5a31216f3cfb38662252428851 /tapset/i386/nd_syscalls.stp
parent4d3c480990cdbbd3e0c405be03a195a040b4dc4a (diff)
downloadsystemtap-steved-d945a07eecee9851173365459d196bcd22c3e636.tar.gz
systemtap-steved-d945a07eecee9851173365459d196bcd22c3e636.tar.xz
systemtap-steved-d945a07eecee9851173365459d196bcd22c3e636.zip
Fixed PR 11269 by properly handling mmap syscall 'fd' argument.
* testsuite/systemtap.syscall/mmap.c (main): Added mprotect and mremap testing (along with testing of anonymous maps). * tapset/i386/syscalls.stp: In mmap probes, handle the fact that the kernel gets an unsigned long 'fd', but the user-side passes a signed int. * tapset/i386/nd_syscalls.stp: Ditto. * tapset/ia64/syscalls.stp: Ditto. * tapset/powerpc/nd_syscalls.stp: Ditto. * tapset/powerpc/syscalls.stp: Ditto. * tapset/x86_64/nd_syscalls.stp: Ditto. * tapset/x86_64/syscalls.stp: Ditto.
Diffstat (limited to 'tapset/i386/nd_syscalls.stp')
-rw-r--r--tapset/i386/nd_syscalls.stp8
1 files changed, 5 insertions, 3 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),