diff options
author | Chris Kay <chris.kay@arm.com> | 2019-12-20 19:23:15 +0000 |
---|---|---|
committer | jimqui01 <54316584+jimqui01@users.noreply.github.com> | 2020-03-11 11:14:37 +0000 |
commit | 5e0088d91e69712bcbeef056a538ca9a3e79e136 (patch) | |
tree | 2ea39b6a5d5224e2ca7fe9e9a56eb2e110443148 /tools/build_system | |
parent | 5e4f8b0865462f9dfa5cecdd8b4bb409940d2a1e (diff) |
bootloader: Don't access R/W memory when bootloading
The RAM firmware image is loaded from the beginning of SRAM, which
overlaps read/write data used by the ROM firmware. This has the
potential to corrupt ROM runtime data that is still being loaded in and
out of memory while it is preparing to boot the image.
This patch removes the image booting logic from the `msys_rom` and
`juno_rom` modules and moves it to the `bootloader` module to ensure
that the transfer is properly and safely contained and controlled.
Other changes to reduce exploitability including updating the stack
pointer to the one expected by the RAM firmware rather than permitting
it to continue from where the ROM firmware left off, and relocating the
vector table to the one embedded in the RAM firmware image, which
prevents the core from using the exception handlers created during ROM
boot (which are in the heap and may have been corrupted while loading
the RAM firmware).
Change-Id: I4413c1cd058ca93ef04177424f1f29561b10872f
Signed-off-by: Chris Kay <chris.kay@arm.com>
Diffstat (limited to 'tools/build_system')
-rw-r--r-- | tools/build_system/rules.mk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/build_system/rules.mk b/tools/build_system/rules.mk index 67bb655d..c7d78249 100644 --- a/tools/build_system/rules.mk +++ b/tools/build_system/rules.mk @@ -166,6 +166,11 @@ endif INCLUDES += $(FWK_DIR)/include # +# Always include CMSIS +# +INCLUDES += $(CMSIS_DIR)/Include + +# # Toolchain-independent flags # CFLAGS += -O$(O) |