scheduler: copy arguments in checktrampoline to prevent a race

This commit is contained in:
Matheus
2026-06-29 02:13:22 -03:00
parent 0de7d4b07f
commit eb798d24b4
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -89,10 +89,10 @@ static bool userspacecheck(void *_args) {
static void checktrampoline(context_t *context, void *_args) {
__assert(ARCH_CONTEXT_INTSTATUS(context) == false);
checkargs_t *args = _args;
userspacecheck(args);
current_cpu()->intstatus = ARCH_CONTEXT_INTSTATUS(args->context);
arch_context_switch(args->context);
checkargs_t args = *(checkargs_t *)_args;
userspacecheck(&args);
current_cpu()->intstatus = ARCH_CONTEXT_INTSTATUS(args.context);
arch_context_switch(args.context);
}
// called right before going back to userspace in the syscall handler, interrupt handler and arch_context_switch
+1 -1
View File
@@ -1,5 +1,5 @@
name=astral
revision=17
revision=18
from_source=astral
imagedeps="build-essential nasm"
hostdeps="xgcc xbinutils limine"