Skip to content

Commit

Permalink
[nrf noup] bootutil: loader: Fix netcore address checking
Browse files Browse the repository at this point in the history
Fixes an issues with wrongly checking the network core reset
address

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
  • Loading branch information
nordicjm committed Sep 17, 2024
1 parent e66169a commit 5db1981
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions boot/bootutil/src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ boot_validated_swap_type(struct boot_loader_state *state,

#ifdef PM_S1_ADDRESS
#ifdef PM_CPUNET_B0N_ADDRESS
if(reset_addr < PM_CPUNET_B0N_ADDRESS)
if(!(reset_addr >= PM_CPUNET_APP_ADDRESS && reset_addr < PM_CPUNET_APP_END_ADDRESS))
#endif
{
const struct flash_area *primary_fa;
Expand Down Expand Up @@ -1396,7 +1396,8 @@ boot_validated_swap_type(struct boot_loader_state *state,
* update and indicate to the caller of this function that no update is
* available
*/
if (upgrade_valid && reset_addr > PM_CPUNET_B0N_ADDRESS) {
if (upgrade_valid && reset_addr >= PM_CPUNET_APP_ADDRESS &&
reset_addr < PM_CPUNET_APP_END_ADDRESS) {
struct image_header *hdr = (struct image_header *)secondary_fa->fa_off;
uint32_t vtable_addr = (uint32_t)hdr + hdr->ih_hdr_size;
uint32_t *net_core_fw_addr = (uint32_t *)(vtable_addr);
Expand Down

0 comments on commit 5db1981

Please sign in to comment.