fix(emulator): use universal flash write function
What changed, and why it matters
This commit changes one line in the Trezor firmware emulator's bootloader simulation. It replaces a function that writes a single 32-bit word to flash storage with a more general 'write data' function. The change appears to be a code cleanup or portability fix for emulator behavior, not a security patch for a real device vulnerability. There is no indication in the commit that this fixes a security issue.
No immediate action required. Treat as routine emulator maintenance. If auditing, verify that flash_area_write_data behaves equivalently for a single 4-byte write and that the offset change from 16 to 0 does not affect emulator state assumptions elsewhere.
Security signals we found
No security framing in commit title or message
[no changelog] tag suggests routine/non-security change
Change is confined to emulator code, not real hardware
Result of flash write still discarded via (void)ret
No bounds/validation logic added or removed
Evidence from the diff
In core/embed/projects/bootloader/emulator.c, the code that simulates non-empty storage during bootloader emulation was changed from flash_area_write_word(&STORAGE_AREAS[0], 16, 0x12345678) to flash_area_write_data(&STORAGE_AREAS[0], 0, &data, sizeof(data)). The offset changed from 16 to 0 and the write is now performed via a generic data-write helper. The commit title frames this as ‘use universal flash write function’ and includes [no changelog], suggesting a refactor or emulator-only consistency fix. The (void)ret pattern means the result is still ignored.
Changed components
core/embed/projects/bootloader/emulator.cTrezor firmware bootloader emulatorInspect captured patch +3 / −1
diff --git a/core/embed/projects/bootloader/emulator.c b/core/embed/projects/bootloader/emulator.c
index 2c1b588f..29f76a56 100644
--- a/core/embed/projects/bootloader/emulator.c
+++ b/core/embed/projects/bootloader/emulator.c
@@ -145,7 +145,9 @@ int main(int argc, char **argv) {
// simulate non-empty storage so that we know whether it was erased or not
if (storage_empty(&STORAGE_AREAS[0])) {
- secbool ret = flash_area_write_word(&STORAGE_AREAS[0], 16, 0x12345678);
+ uint32_t data = 0x12345678;
+ secbool ret =
+ flash_area_write_data(&STORAGE_AREAS[0], 0, &data, sizeof(data));
(void)ret;
}
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.