diff options
author | jistone <jistone> | 2007-02-07 02:54:30 +0000 |
---|---|---|
committer | jistone <jistone> | 2007-02-07 02:54:30 +0000 |
commit | b8772cce090adb3d27cdd8b49d236662b526424e (patch) | |
tree | f216b71b2bea50d0bd95c9d22956a07e0b6fa49c /tapset/signal.stp | |
parent | 3b4136ca14c78881c50e8c36fa35fa574edaabb4 (diff) | |
download | systemtap-steved-b8772cce090adb3d27cdd8b49d236662b526424e.tar.gz systemtap-steved-b8772cce090adb3d27cdd8b49d236662b526424e.tar.xz systemtap-steved-b8772cce090adb3d27cdd8b49d236662b526424e.zip |
2007-02-06 Josh Stone <joshua.i.stone@intel.com>
* aux_syscalls.stp, inet_sock.stp, ioblock.stp, ioscheduler.stp,
nfs.stp, nfs_proc.stp, nfsd.stp, rpc.stp, scsi.stp, signal.stp,
socket.stp, task.stp, tcp.stp, vfs.stp: Protect pointer dereferences
with kread wherever possible. Some places still have hazards, as
marked with FIXMEs.
* errno.stp (returnstr): Don't use return in tapset C functions.
* aux_syscalls.stp (__uget_timex_m): Ditto.
* nfsd.stp (__get_fh): Ditto.
* nfs.stp, vfs.stp (<many functions>): Ditto.
* string.stp (substr): Ditto. Also make sure start index is valid.
* syscalls.stp (syscall.execve): Change __string to kernel_string.
LKET/
* nfs.stp, nfs_proc.stp, nfsd.stp, process.stp, tskdispatch.stp:
Protect pointer dereferences with kread wherever possible. Some
places still have hazards, as marked with FIXMEs.
* aio.stp (log_io_getevents): Don't use return in tapset C functions.
* timestamp.stp (set_timing_method): Ditto.
* utils.stp (filter_by_pid): Ditto.
Diffstat (limited to 'tapset/signal.stp')
-rw-r--r-- | tapset/signal.stp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/tapset/signal.stp b/tapset/signal.stp index da220bab..33a2202c 100644 --- a/tapset/signal.stp +++ b/tapset/signal.stp @@ -450,19 +450,14 @@ probe signal.procmask = kernel.function("sigprocmask") } function get_sigset:long(sigset:long) %{ /* pure */ - + int i; sigset_t *sigset = (sigset_t *)((long)THIS->sigset); - -if(_NSIG_BPW == 64) - THIS->__retvalue = deref(sizeof(sigset_t), sigset); -else if(_NSIG_BPW == 32) - THIS->__retvalue = deref(sizeof(int), &(sigset->sig[0])) | - ((u_int64_t)deref(sizeof(int), &(sigset->sig[1])))<<32; - - if(0) { -deref_fault: - CONTEXT->last_error = "pointer deref error"; + THIS->__retvalue = kread(&(sigset->sig[0])); + for (i=1; i<_NSIG_WORDS; ++i) { + uint64_t part = kread(&(sigset->sig[i])); + THIS->__retvalue |= part << (_NSIG_BPW*i); } + CATCH_DEREF_FAULT(); %} probe signal.procmask.return = kernel.function("sigprocmask").return |