summaryrefslogtreecommitdiff
path: root/kern/processor.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-05-29 14:44:39 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-05-29 15:32:43 +0200
commit99a43d36c83d318f24edd8c6d80f060686a6c398 (patch)
treec4ab9a60249e92a8ef8d2b61a5cddef9e9e8d44b /kern/processor.c
parentb2b8bf37934087f8fb2a246316ecf9e91955ec57 (diff)
kern: fix argument handling
Previously, the processor argument was not checked. If called with a non-processor argument (like a task), `processor' is set to NULL, triggering a page fault. Likewise for the other functions. * kern/processor.c (processor_get_assignment): Fix argument handling. * kern/task.c (task_get_assignment): Likewise. * kern/thread.c (thread_get_assignment): Likewise.
Diffstat (limited to 'kern/processor.c')
-rw-r--r--kern/processor.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kern/processor.c b/kern/processor.c
index 865c324..48e9273 100644
--- a/kern/processor.c
+++ b/kern/processor.c
@@ -657,6 +657,8 @@ processor_get_assignment(
processor_set_t *pset)
{
int state;
+ if (processor == PROCESSOR_NULL)
+ return KERN_INVALID_ARGUMENT;
state = processor->state;
if (state == PROCESSOR_SHUTDOWN || state == PROCESSOR_OFF_LINE)