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

modules/mcuboot/nrf53_hooks: fix boot_image_check_hook() #12846

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

nvlsianpu
Copy link
Contributor

@nvlsianpu nvlsianpu commented Oct 24, 2023

boot_image_check_hook() implementation shall return fih_ret value type. The function should return FIH_BOOT_HOOK_REGULAR instead of BOOT_HOOK_REGULAR.

If the Fault Injection Hardening (FIH) is enabled then fih_int type is different than fih_ret type. Also BOOT_HOOK_REGULAR and FIH_BOOT_HOOK_REGULAR are not the same things.

ref. NCSDK-24203

Consequence of this is that when FIH is enabled, the standard boot_image_check() call is never performed by the mcuboot (for real images) and subsequent checks gets BOOT_HOOK_REGULAR as its results. In mcuboot loader.c this prematurely cause identification of invalid image.

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Oct 24, 2023
@nvlsianpu nvlsianpu added the bugfix Fixes a known bug label Oct 24, 2023
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Oct 24, 2023

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-ci-nrfconnect-boot-fw-update X
test-fw-nrfconnect-chip X
test-fw-nrfconnect-zigbee X
test-sdk-find-my X
test-sdk-sidewalk X

Detailed information of selected test modules

Note: This message is automatically posted and updated by the CI

@nvlsianpu nvlsianpu requested a review from rakons October 24, 2023 15:06
@nvlsianpu nvlsianpu added this to the 2.5.0 milestone Oct 24, 2023
boot_image_check_hook() implementation shall return
fih_ret value type. The function should return FIH_BOOT_HOOK_REGULAR
instead of BOOT_HOOK_REGULAR.

If the Fault Injection Hardening (FIH) is enabled then fih_int type is
different than fih_ret type. Also BOOT_HOOK_REGULAR and
FIH_BOOT_HOOK_REGULAR are not the same things.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
@nvlsianpu
Copy link
Contributor Author

PR Rebased - CI issues were related to platform which are not affected by this patch, so probably it must have been fixed aside.

@jumi-nordic jumi-nordic self-requested a review October 25, 2023 09:53
Copy link
Contributor

@jumi-nordic jumi-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally - fixed

@cvinayak
Copy link
Contributor

@nvlsianpu please get changelog update and/or known issue update requested in #12657

@peknis
Copy link
Contributor

peknis commented Oct 25, 2023

Not really reviewing code. In case of potential need to update rel notes or known issues, we have a PR open for both. Please add such needs as comments in respective PRs.

@rakons rakons removed this from the 2.5.0 milestone Oct 25, 2023
@rakons
Copy link
Contributor

rakons commented Oct 25, 2023

Removed from the 2.5.0 scope - agreed to have known issues update: #12657 (review)

@cvinayak cvinayak merged commit 00ee7b3 into nrfconnect:main Oct 27, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a known bug changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants