syscall: handle: fix lock-related bugs

This commit is contained in:
2026-04-30 19:12:47 +01:00
parent 4a6809e2df
commit ed54dca3ba
+4 -2
View File
@@ -61,6 +61,7 @@ kern_status_t sys_kern_handle_transfer(
src_task = task_cast(obj);
if (!src_task) {
status = KERN_INVALID_ARGUMENT;
task_unlock_irqrestore(self, flags);
goto cleanup;
}
} else {
@@ -81,6 +82,7 @@ kern_status_t sys_kern_handle_transfer(
dest_task = task_cast(obj);
if (!dest_task) {
status = KERN_INVALID_ARGUMENT;
task_unlock_irqrestore(self, flags);
goto cleanup;
}
} else {
@@ -92,12 +94,12 @@ kern_status_t sys_kern_handle_transfer(
src_handle,
&src_object,
&handle_flags);
task_unlock_irqrestore(self, flags);
if (status != KERN_OK) {
goto cleanup;
}
task_unlock_irqrestore(self, flags);
struct handle *dest = NULL;
task_lock_irqsave(dest_task, &flags);
status = handle_table_alloc_handle(