From 5210d2fa5095f0a0cb100c4d6083e948012e1a4e Mon Sep 17 00:00:00 2001 From: cepetr Date: Tue, 20 Aug 2024 08:53:22 +0200 Subject: [PATCH] fix(embed/core): fix stack protection on STM32U5 [no changelog] --- core/embed/boardloader/startup_stm32u5.s | 2 +- core/embed/bootloader/startup_stm32u5.s | 2 +- core/embed/bootloader_ci/startup_stm32u5.s | 2 +- core/embed/firmware/startup_stm32u5.S | 2 +- core/embed/prodtest/startup_stm32u5.s | 2 +- core/embed/reflash/startup_stm32u5.s | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/embed/boardloader/startup_stm32u5.s b/core/embed/boardloader/startup_stm32u5.s index fc30e4b637..3665db2de5 100644 --- a/core/embed/boardloader/startup_stm32u5.s +++ b/core/embed/boardloader/startup_stm32u5.s @@ -7,7 +7,7 @@ reset_handler: // set the stack protection ldr r0, =_sstack - add r0, r0, #16 // padding + add r0, r0, #128 // safety margin for the exception frame msr MSPLIM, r0 bl SystemInit diff --git a/core/embed/bootloader/startup_stm32u5.s b/core/embed/bootloader/startup_stm32u5.s index 0f90b01087..6f5c36e73b 100644 --- a/core/embed/bootloader/startup_stm32u5.s +++ b/core/embed/bootloader/startup_stm32u5.s @@ -7,7 +7,7 @@ reset_handler: // set the stack protection ldr r0, =_sstack - add r0, r0, #16 // padding + add r0, r0, #128 // safety margin for the exception frame msr MSPLIM, r0 // setup environment for subsequent stage of code diff --git a/core/embed/bootloader_ci/startup_stm32u5.s b/core/embed/bootloader_ci/startup_stm32u5.s index ab5b61495d..707b7a320c 100644 --- a/core/embed/bootloader_ci/startup_stm32u5.s +++ b/core/embed/bootloader_ci/startup_stm32u5.s @@ -7,7 +7,7 @@ reset_handler: // set the stack protection ldr r0, =_sstack - add r0, r0, #16 // padding + add r0, r0, #128 // safety margin for the exception frame msr MSPLIM, r0 // setup environment for subsequent stage of code diff --git a/core/embed/firmware/startup_stm32u5.S b/core/embed/firmware/startup_stm32u5.S index f37f5b0928..db9a204c31 100644 --- a/core/embed/firmware/startup_stm32u5.S +++ b/core/embed/firmware/startup_stm32u5.S @@ -7,7 +7,7 @@ reset_handler: // set the stack protection ldr r0, =_sstack - add r0, r0, #16 // padding + add r0, r0, #128 // safety margin for the exception frame msr MSPLIM, r0 // setup environment for subsequent stage of code diff --git a/core/embed/prodtest/startup_stm32u5.s b/core/embed/prodtest/startup_stm32u5.s index f37f5b0928..db9a204c31 100644 --- a/core/embed/prodtest/startup_stm32u5.s +++ b/core/embed/prodtest/startup_stm32u5.s @@ -7,7 +7,7 @@ reset_handler: // set the stack protection ldr r0, =_sstack - add r0, r0, #16 // padding + add r0, r0, #128 // safety margin for the exception frame msr MSPLIM, r0 // setup environment for subsequent stage of code diff --git a/core/embed/reflash/startup_stm32u5.s b/core/embed/reflash/startup_stm32u5.s index f37f5b0928..db9a204c31 100644 --- a/core/embed/reflash/startup_stm32u5.s +++ b/core/embed/reflash/startup_stm32u5.s @@ -7,7 +7,7 @@ reset_handler: // set the stack protection ldr r0, =_sstack - add r0, r0, #16 // padding + add r0, r0, #128 // safety margin for the exception frame msr MSPLIM, r0 // setup environment for subsequent stage of code