From 64d078c65490bab68201d1c1075f60c4caed426f Mon Sep 17 00:00:00 2001 From: Matheus Date: Fri, 5 Dec 2025 18:20:09 -0300 Subject: [PATCH] archctl: boundary check --- kernel-src/arch/x86-64/archctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel-src/arch/x86-64/archctl.c b/kernel-src/arch/x86-64/archctl.c index 249cc272..51a04cd2 100644 --- a/kernel-src/arch/x86-64/archctl.c +++ b/kernel-src/arch/x86-64/archctl.c @@ -17,6 +17,11 @@ syscallret_t syscall_archctl(context_t *context, int func, void *arg) { .ret = 0 }; + if (!IS_USER_ADDRESS(arg)) { + ret.errno = EFAULT; + return ret; + } + switch (func) { case ARCH_CTL_SET_GSBASE: // kernelgsbase because it will be switched out to user