From 256db60ebffef396733e6887b94c2e9a9eb0e7db Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 15 Dec 2022 15:54:56 -0800 Subject: [PATCH] kernel: mark z_cstart to not have stack protector Most of the time, z_cstart() is running on an arbitrary region of memory as stack, where the necessary stack setup has not been performed. This prevents stack protection to work correctly, as the stack canary has not been populated. So mark z_cstart() to have no stack protection at all inside the function to avoid raising exception during boot. Signed-off-by: Daniel Leung --- kernel/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/init.c b/kernel/init.c index 3db6cec0eec..950fc294692 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -498,6 +498,7 @@ sys_rand_fallback: * @return Does not return */ __boot_func +FUNC_NO_STACK_PROTECTOR FUNC_NORETURN void z_cstart(void) { /* gcov hook needed to get the coverage report.*/