mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
scheduler: copy arguments in checktrampoline to prevent a race
This commit is contained in:
@@ -89,10 +89,10 @@ static bool userspacecheck(void *_args) {
|
|||||||
|
|
||||||
static void checktrampoline(context_t *context, void *_args) {
|
static void checktrampoline(context_t *context, void *_args) {
|
||||||
__assert(ARCH_CONTEXT_INTSTATUS(context) == false);
|
__assert(ARCH_CONTEXT_INTSTATUS(context) == false);
|
||||||
checkargs_t *args = _args;
|
checkargs_t args = *(checkargs_t *)_args;
|
||||||
userspacecheck(args);
|
userspacecheck(&args);
|
||||||
current_cpu()->intstatus = ARCH_CONTEXT_INTSTATUS(args->context);
|
current_cpu()->intstatus = ARCH_CONTEXT_INTSTATUS(args.context);
|
||||||
arch_context_switch(args->context);
|
arch_context_switch(args.context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// called right before going back to userspace in the syscall handler, interrupt handler and arch_context_switch
|
// called right before going back to userspace in the syscall handler, interrupt handler and arch_context_switch
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
name=astral
|
name=astral
|
||||||
revision=17
|
revision=18
|
||||||
from_source=astral
|
from_source=astral
|
||||||
imagedeps="build-essential nasm"
|
imagedeps="build-essential nasm"
|
||||||
hostdeps="xgcc xbinutils limine"
|
hostdeps="xgcc xbinutils limine"
|
||||||
|
|||||||
Reference in New Issue
Block a user