summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2019-03-20 17:26:49 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-05-02 05:38:25 -0700
commit4ffa4bb861612f9debffc9088bac72a1ac611ff5 (patch)
tree6b381e78bdec26297d8d04d9f3767f07cd322e3e /common
parent19915c08ec2828235d5db7b0d3a990ab165649cd (diff)
downloadchrome-ec-4ffa4bb861612f9debffc9088bac72a1ac611ff5.tar.gz
kukui_scp: Enable MPU to protect code RAM and data RAM in RW image.
kukui_scp is loaded into SRAM. We would like to protect the memory from a modified code RAM content and executing injected code in data RAM. BRANCH=None BUG=b:123269246 TEST=Apply MPU test patch https://crrev.com/c/1530265. Test data ram XN: 1. mpu 0 # disable MPU 2. mpu_test # see it prints 3. mpu 1 # enable MPU 4. mpu_test # memory access violation, and reset. 5. mpu_test # memory access violation, and reset # again. (MPU enabled by default) Test code ram RO: 1. rw 0x8 0x5566 # Write to code RAM and see memory # access violation and reset. 2. mpu 0 # disable MPU 3. rw 0x8 0x5566 # Nothing happended 4. rw 0x8 # Read 0x5566 5. mpu 1 # enable MPU 6. rw 0x8 0x5566 # memory access violation. Change-Id: I6af5029d8c55d795543d4759b2c9168a06eb9ff1 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1530264 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/system.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/system.c b/common/system.c
index 53282b278d..430b611174 100644
--- a/common/system.c
+++ b/common/system.c
@@ -403,7 +403,7 @@ void system_disable_jump(void)
return;
}
-#ifdef CONFIG_EXTERNAL_STORAGE
+#if defined(CONFIG_EXTERNAL_STORAGE) || !defined(CONFIG_FLASH_PHYSICAL)
/*
* Protect code RAM from being overwritten
*/