sched: enforce ref-counting on current task/thread pointers

This commit is contained in:
2026-04-01 18:17:05 +01:00
parent 15c2207ab9
commit 512356ac2d
28 changed files with 364 additions and 103 deletions
+6 -2
View File
@@ -8,18 +8,22 @@ kern_status_t sys_futex_wait(
kern_futex_t new_val,
unsigned int flags)
{
struct task *self = current_task();
struct task *self = get_current_task();
if (!validate_access_r(self, futex, sizeof *futex)) {
put_current_task(self);
return KERN_MEMORY_FAULT;
}
futex_key_t key;
kern_status_t status = futex_get(futex, &key, flags);
if (status != KERN_OK) {
put_current_task(self);
return status;
}
return futex_wait(key, new_val, flags);
status = futex_wait(key, new_val, flags);
put_current_task(self);
return status;
}
kern_status_t sys_futex_wake(