You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RoT update_server should provide its current view of the stage0, A, and B flash banks.
On RoT, the unused trailing flash sectors are undefined to allow for flexibility in their future use.
The trailing sectors may be in the erased state or may hold content.
There is also a difference between the canonical byte stream that is signed and the byte stream of the contents of a flash bank which would include the signature block and may include trailing bytes in the last sector as well.
The NXP LPC55Sx also skips over one header field (IIRC) when computing the hash for signature verification.
Since we care about the contents of unused flash sectors because of their potential use in exfiltration attacks or for storing malicious code or data, we want the entire bank hashed.
This creates a bit more work during update to be able to predict the layout in the target device and hash given that we already have code to mirror the LPC55 signature verification routine.
It is suggested that update server return something like RotFlashContents below:
struct BankHash {
physaddr: u32,
length: u32,
hash: [u8; 32], // Make it clear what algorithm is in use with an appropriate type.
}
stage1 (a.k.a. pre-kernel, a.k.a.) already computes the bank hashes prior to update_server's start. Update_server's primary function is to mutate those contents which makes the original stage1 information inaccurate during an update procedure.
Looking ahead, we would also want SPFlashContents, but that speculates on having the RoT implement measurement and bank selection policy enforcement against the SP using SWD. That's an issue for another day.
The text was updated successfully, but these errors were encountered:
This PR has four commits to simplify reviewing.
- The first is Laura's macro to manipulate the HASHCRYPT interrupt
vector.
- 2nd is pre-main kernel changes to create a staging area for Bootleby
update and to validate the (now) four RoT flash banks and record those
results for use by update_server.
- 3rd are the API changes to support stage0 update including treating
the bootloader as a separate component with A (active) and B
(stage0next) banks.
- last is the code in the RoT update_server to actually update stage0
Before merging this PR, Cargo.toml needs to be edited to reference the
gateway-message-service main branch.
Merging needs to be coordinated with an MGS merge.
Closes#1043, #1404, #1548, #1353,
RoT update_server should provide its current view of the stage0, A, and B flash banks.
On RoT, the unused trailing flash sectors are undefined to allow for flexibility in their future use.
The trailing sectors may be in the erased state or may hold content.
There is also a difference between the canonical byte stream that is signed and the byte stream of the contents of a flash bank which would include the signature block and may include trailing bytes in the last sector as well.
The NXP LPC55Sx also skips over one header field (IIRC) when computing the hash for signature verification.
Since we care about the contents of unused flash sectors because of their potential use in exfiltration attacks or for storing malicious code or data, we want the entire bank hashed.
This creates a bit more work during update to be able to predict the layout in the target device and hash given that we already have code to mirror the LPC55 signature verification routine.
It is suggested that update server return something like RotFlashContents below:
struct BankHash {
physaddr: u32,
length: u32,
hash: [u8; 32], // Make it clear what algorithm is in use with an appropriate type.
}
struct RotFlashContents {
stage0: BankHash,
a: BankHash,
b: BankHash,
}
stage1 (a.k.a. pre-kernel, a.k.a.) already computes the bank hashes prior to update_server's start. Update_server's primary function is to mutate those contents which makes the original stage1 information inaccurate during an update procedure.
Looking ahead, we would also want SPFlashContents, but that speculates on having the RoT implement measurement and bank selection policy enforcement against the SP using SWD. That's an issue for another day.
The text was updated successfully, but these errors were encountered: