diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-10-31 19:49:33 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-10-31 19:49:33 +0100 |
commit | feb6152de7152b10762a877cb49f60b134e481cc (patch) | |
tree | 17331766aeab809eecbc7db4a5478deadee05095 | |
parent | 64a2434c9d6bc177df6f20ac42c0fd26fb2ba3b9 (diff) | |
download | gnumach-feb6152de7152b10762a877cb49f60b134e481cc.tar.gz gnumach-feb6152de7152b10762a877cb49f60b134e481cc.tar.bz2 gnumach-feb6152de7152b10762a877cb49f60b134e481cc.zip |
gsync: Fix crash when task is not current task
* kern/gsync.c (gsync_wait, gsync_wake, gsync_requeue): Return
KERN_FAILURE when task != current_task().
-rw-r--r-- | kern/gsync.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/gsync.c b/kern/gsync.c index d0f609fb..be7e6695 100644 --- a/kern/gsync.c +++ b/kern/gsync.c @@ -188,6 +188,9 @@ kern_return_t gsync_wait (task_t task, vm_offset_t addr, struct gsync_waiter w; int bucket = gsync_fill_key (task, addr, flags, &w.key); + if (unlikely (task != current_task())) + /* Not implemented yet. */ + return (KERN_FAILURE); if (unlikely (bucket < 0)) return (KERN_INVALID_ADDRESS); @@ -280,6 +283,9 @@ kern_return_t gsync_wake (task_t task, struct gsync_key key; int bucket = gsync_fill_key (task, addr, flags, &key); + if (unlikely (task != current_task())) + /* Not implemented yet. */ + return (KERN_FAILURE); if (unlikely (bucket < 0)) return (KERN_INVALID_ADDRESS); @@ -328,6 +334,9 @@ kern_return_t gsync_requeue (task_t task, vm_offset_t src, int src_bkt = gsync_fill_key (task, src, flags, &src_k); int dst_bkt = gsync_fill_key (task, dst, flags, &dst_k); + if (unlikely (task != current_task())) + /* Not implemented yet. */ + return (KERN_FAILURE); if ((src_bkt | dst_bkt) < 0) return (KERN_INVALID_ADDRESS); |