syscall: task: fix task_duplicate not taking a reference to the new task's address space
This commit is contained in:
+7
-6
@@ -540,18 +540,19 @@ kern_status_t sys_task_duplicate(
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
schedule_thread_on_cpu(new_thread);
|
|
||||||
|
|
||||||
child_handle_slot->h_object = &new_task->t_base;
|
child_handle_slot->h_object = &new_task->t_base;
|
||||||
space_handle_slot->h_object = &new_task->t_address_space->s_base;
|
space_handle_slot->h_object
|
||||||
|
= object_ref(&new_task->t_address_space->s_base);
|
||||||
task_unlock_irqrestore(self, flags);
|
task_unlock_irqrestore(self, flags);
|
||||||
|
|
||||||
*out_task = child_handle;
|
|
||||||
*out_address_space = space_handle;
|
|
||||||
|
|
||||||
/* clear TLB */
|
/* clear TLB */
|
||||||
pmap_switch(self->t_pmap);
|
pmap_switch(self->t_pmap);
|
||||||
put_current_task(self);
|
put_current_task(self);
|
||||||
|
|
||||||
|
*out_task = child_handle;
|
||||||
|
*out_address_space = space_handle;
|
||||||
|
|
||||||
|
schedule_thread_on_cpu(new_thread);
|
||||||
|
|
||||||
return KERN_OK;
|
return KERN_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user