From: Diego Nieto Cid <[email protected]>

  * kern/task.c (task_priority): check new priority against the
    tasks max_priority. Reject with KERN_NO_ACCES when going
    higher than it.
---
 kern/task.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kern/task.c b/kern/task.c
index 61a30502..07d2a020 100644
--- a/kern/task.c
+++ b/kern/task.c
@@ -1163,6 +1163,10 @@ task_priority(
                return KERN_INVALID_ARGUMENT;
 
        task_lock(task);
+       if (task->max_priority > priority) {
+               task_unlock(task);
+               return KERN_NO_ACCESS;
+       }
        task->priority = priority;
 
        if (change_threads) {
-- 
2.53.0


Reply via email to