Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Upgrade artifact actions #378

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
bf74f34
[nrf fromtree] boot: SHA512 verification
michalek-no May 20, 2024
9cb8f93
[nrf fromlist] imgtool: Add support for calculating SHA512
de-nordic Aug 22, 2024
a92ee3c
[nrf fromlist] boot: Replace boot_encrypt by boot_enc_encrypt and boo…
de-nordic Jul 18, 2024
2b70952
[nrf fromlist] scripts: imgtool: compression
michalek-no Aug 9, 2024
5040256
[nrf fromtree] boot: bootutil: loader: Fix slot info for directXIP/RA…
nordicjm Sep 25, 2024
218c63d
[nrf fromtree] boot: bootutil: loader: Fix issue with using pointers
nordicjm Sep 27, 2024
3d346f7
[nrf fromtree] scripts: imgtool: compression
michalek-no Aug 9, 2024
a46eb1e
[nrf fromlist] boot: bootutil: swap_scratch: Fix compressed image sec…
nordicjm Oct 7, 2024
10df2a3
[nrf fromlist] scripts: imgtool: compression ARM thumb filter
michalek-no Oct 4, 2024
af4e468
[nrf fromlist] zephyr: Fixing Kconfig dependency for SHA512
de-nordic Oct 8, 2024
2b568d8
[nrf fromlist] scipts: imgtool: bugfix #2096
michalek-no Oct 15, 2024
a5786cd
[nrf fromlist] imgtool: Add pure signature support
de-nordic Sep 12, 2024
283fd06
[nrf fromlist] imgtool: create image obj with image_hash
nvlsianpu Oct 19, 2024
3d2808d
[nrf fromtree] bootutil: Add SIG_PURE TLV
de-nordic Aug 2, 2024
6813bbb
[nrf noup] github: Add a commit tags check workflow
carlescufi Oct 10, 2023
7f05233
[nrf noup] zephyr: Remove duplication from cmake
sigvartmh Mar 26, 2019
60c998f
[nrf noup] zephyr: add 'minimal' configuration files
mbolivar-nordic Sep 3, 2021
1e82a20
[nrf noup] boards: add support for Thingy:91
bjda Sep 20, 2019
4be7cf8
[nrf noup] zephyr: Restore default RTC user channel count
Damian-Nordic Mar 21, 2022
932db78
[nrf noup] boards: thingy91x: add board config
maxd-nordic Dec 8, 2023
c13d7b3
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 12, 2018
33cf05d
[nrf noup] boot: nrf53-specific customizations
sigvartmh Aug 27, 2020
0a3f9c7
[nrf noup] zephyr: clean peripherals state before boot
nvlsianpu Feb 27, 2020
9aa2a23
[nrf noup] zephyr: Clean up non-secure RAM if enabled
sigvartmh Jan 6, 2023
4081b79
[nrf noup] loader: Fix reading reset addr to support ext flash
chrta Feb 10, 2022
a97a24c
[nrf noup] zephyr: Fix path variables
nordicjm Jul 11, 2023
c2eb5fc
[nrf noup] loader: Do not check reset vector for XIP image
de-nordic Sep 22, 2023
002409b
[nrf noup] zephyr: Add RAM flash configuration to cache for sysbuild
nordicjm Sep 18, 2023
c6fe3b4
[nrf noup] zephyr: Boot even if EXT_ABI is not provided
sigvartmh Oct 17, 2023
fecd88c
[nrf noup] loader: Add firmware version check downgrade prevention
sigvartmh Sep 27, 2023
2ce124e
[nrf noup] boards: thingy53: disable GPIO ISR support
nika-nordic Oct 9, 2023
38da586
[nrf noup] boot/zephyr/boards: nRF54l15pdk ext flash cfg
nvlsianpu Apr 11, 2024
6b43e71
[nrf noup] loader: work-around for multi-image builds
sigvartmh Mar 30, 2021
3335555
[nrf noup] loader: Fix missing PCD define check
nordicjm Aug 31, 2023
73e8c3d
[nrf noup] boot: Add support for NSIB and multi-image
sigvartmh May 31, 2023
628fcbd
[nrf noup] sysflash: Move partition manager definitions to pm_sysflash.h
de-nordic Aug 10, 2023
dd4451b
[nrf noup] sysflash: Add support for three images
de-nordic Aug 11, 2023
d002ffe
[nrf noup] loader: introduced cleanup of unusable secondary slot
nvlsianpu Feb 15, 2024
da14b70
[nrf noup] boards: nrf54l15: Disable FPROTECT
gchwier Apr 16, 2024
5f10ba0
[nrf noup] loader: remove cleanup for direct xip mode
gchwier May 17, 2024
0cb3858
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash partition
nvlsianpu Apr 15, 2024
a38a17e
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash update
nvlsianpu May 20, 2024
b27bf53
[nrf noup] boards: thingy91x: enable serial recovery
maxd-nordic Mar 12, 2024
6e47305
[nrf noup] boot: zephyr: Disable boot banner if NCS_BOOT_BANNER is used
rlubos May 17, 2024
362a944
[nrf noup] boot/zephyr: fix fw_info search
nvlsianpu May 27, 2024
861a34e
[nrf noup] Revert of zephyr: arm: Update reading the flash image rese…
de-nordic May 28, 2024
4d86e37
[nrf noup] zephyr/boards: fix nrf54l15pdk ext flash dts overlay
nvlsianpu Jun 5, 2024
8f74833
[nrf noup] boot: zephyr: Add NCS boot banner
nordicjm Jun 11, 2024
1953d93
[nrf noup] boot/../loader: skip downgrade prevention for s1/s0
nvlsianpu Jun 13, 2024
5f52f93
[nrf noup] boot/../loader: reboot after updating s0/s1
nvlsianpu Jun 18, 2024
b3d65d9
[nrf noup] bootutil: loader: Fix netcore address checking
nordicjm Aug 29, 2024
4786da4
[nrf noup] boards: nrf54l15dk: Disable FPROTECT
nvlsianpu Sep 18, 2024
8809820
[nrf noup] zephyr: Add support for compressed image updates
nordicjm Aug 22, 2024
106ade3
[nrf noup] boot: Add shared crypto for ECDSA and SHA
sigvartmh Feb 14, 2019
3cdcdb3
[nrf noup] PSA configuration required changes
de-nordic Jul 24, 2024
9e1d883
[nrf noup] PSA implementation of x25519 and ed25519 verification
de-nordic May 29, 2024
10211d4
[nrf noup] bootutil: Provide support for SHA512 with ED25519
de-nordic Aug 2, 2024
b4e5a3b
[nrf noup] bootutil: Enable hash calculation directly on storage
de-nordic Sep 5, 2024
81988f9
[nrf noup] bootutil: PureEdDSA using ED25519
de-nordic Sep 6, 2024
a023c2e
[nrf noup] boot/zephyr/Kconfig: conditionally disable BOOT_MAX_IMG_SE…
nvlsianpu Sep 19, 2024
ded8242
[nrf noup] zephyr: Add support for ARM thumb filter
nordicjm Sep 2, 2024
2d5a490
[nrf noup] Remove setting default MCUboot mbedTLS config
de-nordic Oct 17, 2024
b3c7d3d
[nrf noup] boot: zephyr: Do not lock PCD region with TF-M
MarkusLassila Aug 30, 2024
ba255be
[nrf noup] treewide: Add support for sysbuild assigned images
nordicjm Sep 10, 2024
4aaec13
[nrf noup] boot: bootutil: loader: Add s0/s1 checking of MCUboot image
nordicjm Oct 15, 2024
d5aa215
[nrf noup] treewide: Add child/parent image support back
nordicjm Oct 17, 2024
40543f1
[nrf noup] bootutil: Add support for KMU stored ED25519 signature key
de-nordic Sep 20, 2024
0ab75e0
[nrf noup] boards: Thingy:91 X release config
maxd-nordic Oct 23, 2024
93f4645
[nrf noup] workflows: Add a backport workflow
carlescufi Oct 25, 2024
0a70e49
[nrf noup] zephyr: Fix compressed chunk size mismatch
nordicjm Oct 25, 2024
352a241
[nrf noup] Fix KMU breaking non-KMU builds of MCUboot
de-nordic Oct 25, 2024
062d3e7
[nrf noup] Bring in missing line
de-nordic Oct 25, 2024
4fc8d2d
[nrf noup] zephyr: Fix issues with ARM thumb decompression
nordicjm Oct 29, 2024
16a7789
[nrf noup] zephyr: Fix issues with compression TLVs
nordicjm Oct 30, 2024
99fee89
[nrf noup] boot: zephyr: decompression: Fix stray sizeof() usage
nordicjm Nov 5, 2024
6b030d7
[nrf noup] boot/zephyr: add nrf54l15dk ext flash configs
michalek-no Nov 7, 2024
e60dc3f
[nrf noup] boot: zephyr: Kconfig update nrf54l15dk symbol for ED25519
michalek-no Nov 7, 2024
b836582
[nrf noup] boot: zephyr: Add experimental selection to compression
nordicjm Nov 7, 2024
bcdf6e2
[nrf fromlist] boot_serial: Support sha256, sha384 and sha512
de-nordic Nov 12, 2024
498c0f8
ci: Upgrade artifact actions
jaci-nordic Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[nrf noup] zephyr: Clean up non-secure RAM if enabled
To ensure that MCUBoot does not leak keys or other material through
memory to non-secure side we clear the memory before jumping to the next
image.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Ole Sæther <ole.saether@nordicsemi.no>
(cherry picked from commit d04dd27)
sigvartmh authored and rlubos committed Oct 24, 2024
commit 9aa2a2374c71647b0003a3bffb535a37164b4666
2 changes: 1 addition & 1 deletion boot/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -575,7 +575,7 @@ if(SYSBUILD)
set(mcuboot_image_upgrade_footer_size ${required_upgrade_size} CACHE INTERNAL "Estimated MCUboot update image trailer size" FORCE)
endif()

if(CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL)
if(CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL OR CONFIG_MCUBOOT_CLEANUP_NONSECURE_RAM)
zephyr_library_sources(
${BOOT_DIR}/zephyr/nrf_cleanup.c
)
5 changes: 5 additions & 0 deletions boot/zephyr/include/nrf_cleanup.h
Original file line number Diff line number Diff line change
@@ -16,4 +16,9 @@
*/
void nrf_cleanup_peripheral(void);

/**
* Perform cleanup of non-secure RAM that may have been used by MCUBoot.
*/
void nrf_cleanup_ns_ram(void);

#endif
5 changes: 4 additions & 1 deletion boot/zephyr/main.c
Original file line number Diff line number Diff line change
@@ -142,7 +142,7 @@ K_SEM_DEFINE(boot_log_sem, 1, 1);
#include <pm_config.h>
#endif

#if CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL
#if CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL || CONFIG_MCUBOOT_NRF_CLEANUP_NONSECURE_RAM
#include <nrf_cleanup.h>
#endif

@@ -219,6 +219,9 @@ static void do_boot(struct boot_rsp *rsp)
#if CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL
nrf_cleanup_peripheral();
#endif
#if CONFIG_MCUBOOT_NRF_CLEANUP_NONSECURE_RAM && defined(PM_SRAM_NONSECURE_NAME)
nrf_cleanup_ns_ram();
#endif
#if CONFIG_MCUBOOT_CLEANUP_ARM_CORE
cleanup_arm_nvic(); /* cleanup NVIC registers */

79 changes: 59 additions & 20 deletions boot/zephyr/nrf_cleanup.c
Original file line number Diff line number Diff line change
@@ -5,9 +5,8 @@
*/

#include <hal/nrf_clock.h>
#if defined(NRF_UARTE0) || defined(NRF_UARTE1)
#include <hal/nrf_uarte.h>
#endif
#include <hal/nrf_uarte.h>
#include <haly/nrfy_uarte.h>
#if defined(NRF_RTC0) || defined(NRF_RTC1) || defined(NRF_RTC2)
#include <hal/nrf_rtc.h>
#endif
@@ -20,6 +19,15 @@

#include <string.h>

#if USE_PARTITION_MANAGER
#include <pm_config.h>
#endif

#if defined(NRF_UARTE0) || defined(NRF_UARTE1) || defined(NRF_UARTE20) || \
defined(NRF_UARTE30)
#define NRF_UARTE_CLEANUP
#endif

#define NRF_UARTE_SUBSCRIBE_CONF_OFFS offsetof(NRF_UARTE_Type, SUBSCRIBE_STARTRX)
#define NRF_UARTE_SUBSCRIBE_CONF_SIZE (offsetof(NRF_UARTE_Type, EVENTS_CTS) -\
NRF_UARTE_SUBSCRIBE_CONF_OFFS)
@@ -37,6 +45,23 @@ static inline void nrf_cleanup_rtc(NRF_RTC_Type * rtc_reg)
}
#endif

#if defined(NRF_UARTE_CLEANUP)
static NRF_UARTE_Type *nrf_uarte_to_clean[] = {
#if defined(NRF_UARTE0)
NRF_UARTE0,
#endif
#if defined(NRF_UARTE1)
NRF_UARTE1,
#endif
#if defined(NRF_UARTE20)
NRF_UARTE20,
#endif
#if defined(NRF_UARTE30)
NRF_UARTE30,
#endif
};
#endif

static void nrf_cleanup_clock(void)
{
nrf_clock_int_disable(NRF_CLOCK, 0xFFFFFFFF);
@@ -53,26 +78,31 @@ void nrf_cleanup_peripheral(void)
#if defined(NRF_RTC2)
nrf_cleanup_rtc(NRF_RTC2);
#endif
#if defined(NRF_UARTE0)
nrf_uarte_disable(NRF_UARTE0);
nrf_uarte_int_disable(NRF_UARTE0, 0xFFFFFFFF);
#if defined(NRF_DPPIC)
/* Clear all SUBSCRIBE configurations. */
memset((uint8_t *)NRF_UARTE0 + NRF_UARTE_SUBSCRIBE_CONF_OFFS, 0, NRF_UARTE_SUBSCRIBE_CONF_SIZE);
/* Clear all PUBLISH configurations. */
memset((uint8_t *)NRF_UARTE0 + NRF_UARTE_PUBLISH_CONF_OFFS, 0, NRF_UARTE_PUBLISH_CONF_SIZE);
#endif
#endif
#if defined(NRF_UARTE1)
nrf_uarte_disable(NRF_UARTE1);
nrf_uarte_int_disable(NRF_UARTE1, 0xFFFFFFFF);

#if defined(NRF_UARTE_CLEANUP)
for (int i = 0; i < sizeof(nrf_uarte_to_clean) / sizeof(nrf_uarte_to_clean[0]); ++i) {
NRF_UARTE_Type *current = nrf_uarte_to_clean[i];

nrfy_uarte_int_disable(current, 0xFFFFFFFF);
nrfy_uarte_int_uninit(current);
nrfy_uarte_task_trigger(current, NRF_UARTE_TASK_STOPRX);

nrfy_uarte_event_clear(current, NRF_UARTE_EVENT_RXSTARTED);
nrfy_uarte_event_clear(current, NRF_UARTE_EVENT_ENDRX);
nrfy_uarte_event_clear(current, NRF_UARTE_EVENT_RXTO);
nrfy_uarte_disable(current);

#if defined(NRF_DPPIC)
/* Clear all SUBSCRIBE configurations. */
memset((uint8_t *)NRF_UARTE1 + NRF_UARTE_SUBSCRIBE_CONF_OFFS, 0, NRF_UARTE_SUBSCRIBE_CONF_SIZE);
/* Clear all PUBLISH configurations. */
memset((uint8_t *)NRF_UARTE1 + NRF_UARTE_PUBLISH_CONF_OFFS, 0, NRF_UARTE_PUBLISH_CONF_SIZE);
/* Clear all SUBSCRIBE configurations. */
memset((uint8_t *)current + NRF_UARTE_SUBSCRIBE_CONF_OFFS, 0,
NRF_UARTE_SUBSCRIBE_CONF_SIZE);
/* Clear all PUBLISH configurations. */
memset((uint8_t *)current + NRF_UARTE_PUBLISH_CONF_OFFS, 0,
NRF_UARTE_PUBLISH_CONF_SIZE);
#endif
}
#endif

#if defined(NRF_PPI)
nrf_ppi_channels_disable_all(NRF_PPI);
#endif
@@ -81,3 +111,12 @@ void nrf_cleanup_peripheral(void)
#endif
nrf_cleanup_clock();
}

#if USE_PARTITION_MANAGER \
&& defined(CONFIG_ARM_TRUSTZONE_M) \
&& defined(PM_SRAM_NONSECURE_NAME)
void nrf_cleanup_ns_ram(void)
{
memset((void *) PM_SRAM_NONSECURE_ADDRESS, 0, PM_SRAM_NONSECURE_SIZE);
}
#endif