From 94997a026fc55a41c7d8ec481698f063dede40e2 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 29 Mar 2024 09:54:47 -0700 Subject: [PATCH] x86: correct size for stack bound check for privileged stack Previous commit changed the privileged stack size to be using kconfig CONFIG_PRIVILEGED_STACK_SIZE instead of simply CONFIG_MMU_PAGE_SIZE. However, the stack bound check function was still using the MMU page size, so fix that. Signed-off-by: Daniel Leung --- arch/x86/core/fatal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/core/fatal.c b/arch/x86/core/fatal.c index 517d2efa290..bd5e3a51d91 100644 --- a/arch/x86/core/fatal.c +++ b/arch/x86/core/fatal.c @@ -72,7 +72,7 @@ bool z_x86_check_stack_bounds(uintptr_t addr, size_t size, uint16_t cs) * If we get here, we must have been doing a syscall, check * privilege elevation stack bounds */ - start = _current->stack_info.start - CONFIG_MMU_PAGE_SIZE; + start = _current->stack_info.start - CONFIG_PRIVILEGED_STACK_SIZE; end = _current->stack_info.start; #endif /* CONFIG_USERSPACE */ } else {