sched: enforce ref-counting on current task/thread pointers
This commit is contained in:
+10
-5
@@ -3,21 +3,26 @@
|
||||
|
||||
kern_status_t sys_kern_config_get(kern_config_key_t key, void *ptr, size_t len)
|
||||
{
|
||||
struct task *self = current_task();
|
||||
struct task *self = get_current_task();
|
||||
kern_status_t status = KERN_OK;
|
||||
|
||||
switch (key) {
|
||||
case KERN_CFG_PAGE_SIZE:
|
||||
if (!validate_access_w(self, ptr, sizeof(uintptr_t))) {
|
||||
return KERN_MEMORY_FAULT;
|
||||
status = KERN_MEMORY_FAULT;
|
||||
break;
|
||||
}
|
||||
|
||||
*(uint32_t *)ptr = VM_PAGE_SIZE;
|
||||
return KERN_OK;
|
||||
status = KERN_OK;
|
||||
break;
|
||||
default:
|
||||
return KERN_INVALID_ARGUMENT;
|
||||
status = KERN_INVALID_ARGUMENT;
|
||||
break;
|
||||
}
|
||||
|
||||
return KERN_UNSUPPORTED;
|
||||
put_current_task(self);
|
||||
return status;
|
||||
}
|
||||
|
||||
kern_status_t sys_kern_config_set(
|
||||
|
||||
Reference in New Issue
Block a user