syscall: handle: fix lock-related bugs
This commit is contained in:
+4
-2
@@ -61,6 +61,7 @@ kern_status_t sys_kern_handle_transfer(
|
|||||||
src_task = task_cast(obj);
|
src_task = task_cast(obj);
|
||||||
if (!src_task) {
|
if (!src_task) {
|
||||||
status = KERN_INVALID_ARGUMENT;
|
status = KERN_INVALID_ARGUMENT;
|
||||||
|
task_unlock_irqrestore(self, flags);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -81,6 +82,7 @@ kern_status_t sys_kern_handle_transfer(
|
|||||||
dest_task = task_cast(obj);
|
dest_task = task_cast(obj);
|
||||||
if (!dest_task) {
|
if (!dest_task) {
|
||||||
status = KERN_INVALID_ARGUMENT;
|
status = KERN_INVALID_ARGUMENT;
|
||||||
|
task_unlock_irqrestore(self, flags);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -92,12 +94,12 @@ kern_status_t sys_kern_handle_transfer(
|
|||||||
src_handle,
|
src_handle,
|
||||||
&src_object,
|
&src_object,
|
||||||
&handle_flags);
|
&handle_flags);
|
||||||
|
task_unlock_irqrestore(self, flags);
|
||||||
|
|
||||||
if (status != KERN_OK) {
|
if (status != KERN_OK) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
task_unlock_irqrestore(self, flags);
|
|
||||||
|
|
||||||
struct handle *dest = NULL;
|
struct handle *dest = NULL;
|
||||||
task_lock_irqsave(dest_task, &flags);
|
task_lock_irqsave(dest_task, &flags);
|
||||||
status = handle_table_alloc_handle(
|
status = handle_table_alloc_handle(
|
||||||
|
|||||||
Reference in New Issue
Block a user