1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-12 14:16:06 +00:00

fix(core): add kernel access to assets by default (#4759)

[no changelog]
This commit is contained in:
cepetr 2025-03-11 07:58:57 +01:00 committed by GitHub
parent d6c0e7e203
commit b5053d9f6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -353,7 +353,10 @@ mpu_mode_t mpu_reconfig(mpu_mode_t mode) {
default:
DIS_REGION( 5 );
DIS_REGION( 6 );
// Assets (Privileged, Read-Only, Non-Executable)
// Subregion: 32KB = 64KB except 2/8 at start and 2/8 at end
// By default, the kernel needs to have the same access to assets as the app
SET_REGION( 6, FLASH_BASE + 0x104000, SIZE_64KB, 0xC3, FLASH_DATA, PRIV_RO );
break;
}
// clang-format on

View File

@ -193,7 +193,7 @@ static inline void mpu_enable(void) {
}
static void mpu_init_fixed_regions(void) {
// Regions #0 to #5 are fixed for all targets
// Regions #0 to #4 are fixed for all targets
// clang-format off
#if defined(BOARDLOADER)
@ -240,7 +240,7 @@ static void mpu_init_fixed_regions(void) {
SET_REGION( 4, AUX1_RAM_START, AUX1_RAM_SIZE, SRAM, YES, NO );
#endif
// Regions #6 and #7 are banked
// Regions #5 to #7 are banked
DIS_REGION( 5 );
DIS_REGION( 6 );
@ -389,7 +389,8 @@ mpu_mode_t mpu_reconfig(mpu_mode_t mode) {
SET_REGION( 6, BOOTARGS_START, BOOTARGS_SIZE, SRAM, YES, NO );
break;
default:
DIS_REGION( 6 );
// By default, the kernel needs to have the same access to assets as the app
SET_REGION( 6, ASSETS_START, ASSETS_MAXSIZE, FLASH_DATA, NO, NO );
break;
}
// clang-format on