From 5e75d8b2bd5fe2087a29f5b264cee22a70e2985d Mon Sep 17 00:00:00 2001 From: TuxSH Date: Mon, 5 Mar 2018 09:41:39 +0100 Subject: [PATCH] Fix func_copy null deref (?) --- exosphere/src/coldboot_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exosphere/src/coldboot_init.c b/exosphere/src/coldboot_init.c index 89b009a12..4ed41f915 100644 --- a/exosphere/src/coldboot_init.c +++ b/exosphere/src/coldboot_init.c @@ -133,6 +133,7 @@ uintptr_t get_coldboot_crt0_stack_address(void) { void coldboot_init(coldboot_crt0_reloc_list_t *reloc_list, boot_func_list_t *func_list, boot_func_list_t *func_list_warmboot) { MAILBOX_NX_SECMON_BOOT_TIME = TIMERUS_CNTR_1US_0; + boot_func_list_t func_copy = *func_list; /* Custom approach */ reloc_list->reloc_base = (uintptr_t)__start_cold; translate_func_list(reloc_list, func_list, false); @@ -173,5 +174,6 @@ void coldboot_init(coldboot_crt0_reloc_list_t *reloc_list, boot_func_list_t *fun func_list->funcs.invalidate_icache_all(); /* At this point we can access all the mapped segments (all other functions, data...) normally */ + *func_list_warmboot = func_copy; translate_func_list(reloc_list, func_list_warmboot, true); }