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

bootutil: fix swap with move reset issue #1597

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Conversation

utzig
Copy link
Member

@utzig utzig commented Feb 7, 2023

Fix a swap corruption which occurs on the swap move algorithm when a reset happens exactly at the point after the last move up, and its status update. On restart the image headers should be read at the 2nd sector of the primary slot, but due to lacking initialization it is read on the first sector, and then fails. This error was masked on the simulator because of the use of a global variable, which retained its value on a "reset simulation".

Fixes #1588

Fix a swap corruption which occurs on the swap move algorithm when a
reset happens exactly at the point after the last move up, and its
status update. On restart the image headers should be read at the 2nd
sector of the primary slot, but due to lacking initialization it is
read on the first sector, and then fails. This error was masked on the
simulator because of the use of a global variable, which retained its
value on a "reset simulation".

Fixes mcu-tools#1588

Signed-off-by: Fabio Utzig <utzig@apache.org>
Copy link
Member

@d3zd3z d3zd3z left a comment

Choose a reason for hiding this comment

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

I wish there was a way to test this in the simulator, but I guess that is kind of happening, given that before this test, it wasn't really being tested.

@utzig utzig merged commit 7453075 into mcu-tools:main Feb 9, 2023
@utzig utzig deleted the fix-swap-move branch February 9, 2023 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zephyr: mcuboot swap using move will brick device when power interrupted during move
3 participants