Having image magic in slot 0 causes incorrect "revert"

Description

Loading an image into slot0 that has the magic in the image trailer (but with copy_done, and image_ok both unset) causes mcuboot to try and perform a revert. One of two things happens:

  • If there is a valid image in slot 1, it'll swap, and boot that, which is probably an old image.

  • If it isn't valid enough to swap, it will not end up swapping.

In either case, it will then jump into the image in slot 0 without performing a signature verification.

There are kind of two issues here, with the incorrect revert, and the fact that upon revert, the signature isn't checked. I will create another ticket specifically for the revert case, since it could be used to circumvent the signature check on its own as well.

Environment

None

Status

Assignee

Aditi Hilbert

Reporter

David Brown

Labels

None

Fix versions

Priority

Highest