Lesson 10 of 14 · 18m
Verified Boot and the Rollback You Forgot
A valid signature doesn't mean fresh firmware: anti-rollback counters, A/B slots, dm-verity, and ESP32 eFuses.
Signature verification answers "is this firmware authentically the vendor's?" It does not answer "is this firmware current?" An attacker who can't forge your key can still flash last year's signed image — valid signature, known CVEs. That gap is the rollback problem, and it's why verified boot chains carry a second mechanism most designs forget.
The chain of trust
Verified boot is staged, not single-shot. An immutable ROM bootloader burns in with the silicon and verifies a signature on the next stage — U-Boot SPL or equivalent — which verifies the kernel, which mounts a rootfs verified by dm-verity. Every stage checks the next before handing execution off. A chain is only as verified as its weakest link: signed kernel over an unchecked rootfs is theater.
U-Boot does this with FIT image signatures. dm-verity builds a Merkle hash tree over the rootfs: every block read at runtime is checked against a signed root hash, so a flipped bit in a single binary fails on access, not just at boot. CONFIG_MODULE_SIG extends the chain to kernel modules. On the ARM MCU side the names differ but the shape is identical: ROM verifies stage two, stage two verifies the application.
Anti-rollback: freshness as a hardware counter
The fix is a monotonic version index: a counter in one-time-programmable or tamper-evident storage — eFuse blocks, eMMC RPMB (the replay-protected memory block built exactly for this), secure element — incremented per release. Each signed image carries its index in signed metadata; the boot chain rejects any image whose index is below the stored counter. Android Verified Boot 2.0 stores the rollback index in vbmeta and enforces it through keystore/keymint. ESP32-S3 does it with SECURE_VERSION eFuse bits under secure boot v2.
Don't conflate it with U-Boot's bootcount/bootlimit — that's a retry counter for failed boots, an availability mechanism, not a security boundary.
ESP32 as the concrete example
One SoC family makes the whole mechanism inspectable end to end:
ESP32-S3 puts the whole story in eFuse: the flash-encryption key lives in a write-protected key block (AES-256-XTS, read-disabled once burned), DIS_DOWNLOAD_MODE kills UART/USB download boot, secure boot v2 verifies RSA-3072 signatures under RSA-PSS — ECDSA-P256 is the option on the newer C2/C5/C6/H2/P4-class chips, not on S3 — and SECURE_VERSION provides anti-rollback. Irreversible by construction — eFuses burn once. That's a manufacturing step, not a config you flip in the field, and the irreversibility is the point.
A/B slots: the update atomicity half
Secure boot pairs with how writes happen. A/B partitioning keeps two slots: the updater writes the inactive slot, verifies the signature and manifest, boots it once, runs a health check — did init come up, do the services respond — then marks the slot good. Failure means automatic rollback to the known-good slot. Half-flashed bricks come from single-slot writers; Android's Seamless Updates are the reference implementation, and the same pattern is what MCUBoot gives MCU-class devices.
Tradeoffs
The honest cost list:
eFuse irreversibility means no recovery from a burned mistake; the rollback index must be managed per SKU or you brick devices with a legitimate downgrade need; losing the signing key ends the product's update life. A/B costs you double the flash footprint for the OS partitions. All cheaper than shipping a boot chain that accepts old signed malware.
Practice checklist
Immutable root of trust verifying the next stage; signed metadata covering model and version index; anti-rollback counter in OTP/RPMB; dm-verity or signed rootfs; A/B writes with health-check rollback; locked bootloader console in production (no setenv bootargs on shipped units). Then test it the way an attacker would: reflash last quarter's signed image and watch it get rejected — if it boots, the rollback index was never wired.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Running a Minecraft Network: Four JVMs, One Box, and the Settings That Lie to You
Four servers on one host means four JVMs each sizing its thread pools for a machine it does not own. The measured cost of that, the systemd ordering that guarantees nothing, and the throttle that switches itself back on when your forwarding breaks.
A Minecraft Mod Is a Program. In 2026, Attackers Started Acting Like It.
A Minecraft mod is a Java program that runs with your account's full permissions, and nothing in the game checks what it does.
Immich Had Fourteen Advisories and One Bug It Fixed Three Times
Immich's 2026 security record runs to fourteen advisories, and they cluster hard: the sharing features, the OAuth plumbing, and one login redirect parameter that took three separate fixes across eighty-three days. Plus the 3.0 migration traps still waiting for anyone who hasn't jumped yet.
Building a Minecraft Network: Four Servers Pretending to Be One Place
A proxy, a lobby, an SMP and a PvP arena is four JVMs that know nothing about each other. What actually has to be shared, why your permissions don't follow players, and the two LuckPerms defaults that silently share nothing at all.