diff options
author | Jeremy Bettis <jbettis@google.com> | 2022-09-09 10:57:41 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-09 19:17:03 +0000 |
commit | 67ac46409cca456859adf1bb4743a3bae3ce30a2 (patch) | |
tree | 36aed0e0de2d7c9c46db01b7ad070808b90a45ab | |
parent | 538a24ab36652a61795d108707b891c3ad4867cc (diff) | |
download | chrome-ec-67ac46409cca456859adf1bb4743a3bae3ce30a2.tar.gz |
zephyr: Make more space in mock_jump_data
The mock_jump_data isn't actually big enough to store tags.
system_add_jump_tag() might write to up to 255 bytes after the jump
data.
BRANCH=None
BUG=None
TEST=Ran my vboot_efs2 test that was getting segfaults.
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Iad4bb52db954831458b894a95d0be0c90cfafea6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3887959
Code-Coverage: Simon Glass <sjg@chromium.org>
Code-Coverage: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 | ||||
-rw-r--r-- | zephyr/shim/src/ztest_system.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 6786dc9b6f..6e4af3badf 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -469,10 +469,11 @@ /* The jump data goes at the end of data ram, so for posix, the end of ram is * wherever the jump data ended up. */ -extern struct jump_data mock_jump_data; +#include "sysjump.h" +extern char mock_jump_data[sizeof(struct jump_data) + 256]; #define CONFIG_RAM_BASE 0x0 #define CONFIG_DATA_RAM_SIZE \ - (((uintptr_t)&mock_jump_data) + sizeof(struct jump_data)) + (((uintptr_t)&mock_jump_data) + sizeof(mock_jump_data)) #else #error "A zephyr,sram device must be chosen in the device tree" #endif diff --git a/zephyr/shim/src/ztest_system.c b/zephyr/shim/src/ztest_system.c index 74491b2b04..e9e95e856c 100644 --- a/zephyr/shim/src/ztest_system.c +++ b/zephyr/shim/src/ztest_system.c @@ -12,13 +12,13 @@ #define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ##args) -struct jump_data mock_jump_data = {}; +char mock_jump_data[sizeof(struct jump_data) + 256]; /* When CONFIG_RAM_SIZE is defined, this is provided by common/system.c */ #ifndef CONFIG_RAM_SIZE struct jump_data *get_jump_data(void) { - return &mock_jump_data; + return (struct jump_data *)&mock_jump_data; } #endif |