-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: Architecturesarea: Kernel
Description
Memory corruption can affect exception handling since for all arches, the stack pointer for handling exceptions is fetched from _kernel. If _kernel is corrupted the stack pointer could get set to some insane value and cause a double fault. However this value doesn't need to be in RAM, it's computed once as K_THREAD_STACK_BUFFER(_interrupt_stack) + CONFIG_ISR_STACK_SIZE and is never touched again. It's essentially a read-only value. It doesn't need to be in RAM.
Remove the irq_stack members from _kernel (for both UP and SMP) and use ROM for it. Initialize a const read-only array at buiild time which contains this information for each CPU, stored in ROM/text region, and have the exception handler read that instead. Do this for all arches.
ioannisg and dleach02
Metadata
Metadata
Assignees
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: Architecturesarea: Kernel