From b8772cce090adb3d27cdd8b49d236662b526424e Mon Sep 17 00:00:00 2001 From: jistone Date: Wed, 7 Feb 2007 02:54:30 +0000 Subject: 2007-02-06 Josh Stone * 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 (): 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. --- tapset/ioscheduler.stp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'tapset/ioscheduler.stp') diff --git a/tapset/ioscheduler.stp b/tapset/ioscheduler.stp index ba732b65..49be6217 100644 --- a/tapset/ioscheduler.stp +++ b/tapset/ioscheduler.stp @@ -109,30 +109,30 @@ probe ioscheduler.elv_completed_request function disk_major_from_request:long(var_q:long) %{ /* pure */ - struct request_queue *q; - struct request *rq; + struct request_queue *q = (struct request_queue *)((long)THIS->var_q); + struct list_head *queue_head = &(q->queue_head); - q = (struct request_queue *)((long)THIS->var_q); - - if(list_empty(&(q->queue_head))) + if (list_empty(&(q->queue_head))) /* FIXME: deref hazard! */ THIS->__retvalue = -1; else { - rq = list_entry_rq(q->queue_head.next); - THIS->__retvalue = rq->rq_disk->first_minor; + struct request *rq = list_entry_rq(q->queue_head.next); /* FIXME: deref hazard! */ + struct gendisk *rq_disk = kread(&(rq->rq_disk)); + THIS->__retvalue = kread(&(rq_disk->major)); } + CATCH_DEREF_FAULT(); %} function disk_minor_from_request:long(var_q:long) %{ /* pure */ - struct request_queue *q; - struct request *rq; - - q = (struct request_queue *)((long)THIS->var_q); + struct request_queue *q = (struct request_queue *)((long)THIS->var_q); + struct list_head *queue_head = &(q->queue_head); - if(list_empty(&(q->queue_head))) + if (list_empty(&(q->queue_head))) /* FIXME: deref hazard! */ THIS->__retvalue = -1; else { - rq = list_entry_rq(q->queue_head.next); - THIS->__retvalue = rq->rq_disk->first_minor; + struct request *rq = list_entry_rq(q->queue_head.next); /* FIXME: deref hazard! */ + struct gendisk *rq_disk = kread(&(rq->rq_disk)); + THIS->__retvalue = kread(&(rq_disk->first_minor)); } + CATCH_DEREF_FAULT(); %} -- cgit