AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 57 Bitcoin

memory: disable NVM caches during programming

Public commit record

What the developer wrote

Authored by benma's agent

76/100 · Adequate
memory: disable NVM caches during programming

On SAMD51 revisions A and D, reading flash while loading the NVM page
buffer can return corrupt data. Our programming routines execute from
flash, so instruction fetches expose them to this erratum even when the
source buffer is in RAM.

Disable both NVMCTRL AHB line caches around explicit page-buffer writes,
following [Microchip's workaround](https://www.microchip.com/DS80000748#page=35)
(DS80000748T, section 2.14.1). Restore the saved controller settings after
programming completes. This covers normal flash and user-row writes,
including BOOTPROT and SmartEEPROM configuration. The BOOTPROT path
resets immediately after programming.

Keep the caches enabled for normal execution: disabling them permanently
stalls stage0 while ICM hashes stage1 directly from flash. Scoping the
workaround to programming also limits its execution-time and power impact.

The change applies to rebuilt firmware, bootloader and factory images.
Ordinary SmartEEPROM data writes are outside its scope.

Co-authored-by: NickeZ Agent <niklas+agent@bitbox.swiss>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a hardware erratum in the microcontroller used by the BitBox02 hardware wallet. When the device writes to its internal flash memory, a bug in certain chip revisions can corrupt data being read from flash at the same time—including the program instructions being fetched to run the write routine. The patch temporarily disables two flash caches only during programming, then restores them afterward. If left unpatched, this could in theory lead to corrupted firmware writes, fuses, or security-critical configuration bits, but the commit is a preventive fix rather than a confirmed exploited vulnerability.

Recommended action

Treat as a security-relevant hardening fix. Rebuild and deploy updated firmware, bootloader, and factory images. Verify that the cache-disable/restore logic is exercised in programming tests, especially for BOOTPROT and SmartEEPROM paths. No immediate incident response is indicated absent evidence of active exploitation.

Security signals we found

01

Fixes a documented silicon erratum that can corrupt flash reads during NVM programming

02

Covers security-sensitive write paths: BOOTPROT fuses and SmartEEPROM configuration

03

Could affect firmware/bootloader integrity if corrupted instructions or fuses were written

04

No explicit CVE, exploit, or incident disclosed in the commit or supplied references

Risk score

Why this scored 57/100

Our methodology →
Potential impact 18/30
Exploitability 8/25
Stealth signal 7/15
Affected reach 12/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.