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
{{ message }}
Repository navigation
docs/security: Correct OTA verification and rollback claims to match avocadoctl - #563
The atomic update page says every device rolls back automatically, that the bootloader tracks boot attempts, that signatures are validated before write, that each boot slot holds the bootloader and device tree, and that Avocado supports delta compression and power-loss detection. The shipped code contradicts or does not implement each of these. Someone planning around the page would rely on protections that are not there, most visibly on Jetson (no device tree or bootloader in the slot, no attempt counter) and with stream_os_to_partition enabled.
What changed
atomic-update-architecture.md: rewritten around what the code does.
The update flow ends in a post-boot AVOCADO_OS_BUILD_ID check run by avocadoctl, with per-board activate, commit and rollback actions.
A "What is verified" table covers metadata signatures, per-target hashes and bundle.json hashes, default vs stream_os_to_partition. It states that bundle.json is unsigned, expires is never read, and metadata versions are not compared.
The rollback section says what triggers it, what does not, and that attempt counting exists only where the board's bootloader environment implements it. Some boards ship no rollback actions.
A per-board table of what an OS update writes (Jetson: rootfs and boot only).
The delta compression and power-loss claims are replaced with what is implemented.
sideloading.md: new "What the device checks" subsection.
seeding-var.md: an OS update does not write the var partition, and avocadoctl does not copy var_files.
features.md: the "Safe OTA with Automatic Rollback" text and the "No bricked devices" callout now say rollback is the post-boot AVOCADO_OS_BUILD_ID check, that attempt counting depends on the board's bootloader, that some boards ship no rollback actions, and that Jetson recovery from a slot that fails to boot depends on NVIDIA firmware. Links to the architecture page.
filesystem-integrity.md: the dm-verity failure step no longer says reboot falls back to the previous slot; avocadoctl rolls back only on a failed post-boot build-id check (sole caller src/commands/ext.rs:524, rollback at src/os_update.rs:573).
update-process.md: "Streaming Mode" states the OS bundle is not compared to the signed targets hash, is verified only by the unsigned bundle.json hashes, and that streaming is off by default (src/update.rs:303-305, :574-592; src/config.rs:42).
stream_os_to_partition is off by default, so the default path is verified against the signed targets hashes. The page says so.
Verified
prettier --check on all six touched files: exit 0.
npm --prefix src run build from origin/main e3e0712: exit 0.
Every claim checked against avocadoctl main (d6e82f3). Only CONTRIBUTING.md differs from v0.15.0, so these citations hold for the release.
Stone manifests read on meta-avocado wrynose (2bdaf34) for os_artifacts, commit and rollback.
Citations (avocadoctl v0.15.0):
Trust anchor and refusal without it: src/update.rs:89-90. Signature checks before any download: :107-153; ed25519 only: :1107-1109.
Per-target SHA-256 and length: :649, :680-717.
Streaming skips staging the bundle: :303-305, piped to apply_os_update_streaming: :574-592. Default off: src/config.rs:42.
Streamed artifacts hashed while written: src/os_update.rs:2717-2750. bundle.json carries no signature: :2856-2885.
expires is read nowhere in the verification code: git grep -i expires -- src hits only test fixtures and display-only fields.
No remote-vs-local metadata version comparison in perform_update (src/update.rs:69-300).
Pending marker, commit and rollback: src/os_update.rs:321, :534, :573. Post-boot check and reboot into the previous slot: src/commands/ext.rs:407-560.
No var_files, delta, power-loss, bootcount or mark-boot-successful handling: git grep -n -i 'var_files\|delta\|power.loss\|bootcount\|boot_tries\|mark-boot-successful' origin/main -- src returns no code hits.
What Jetson boot firmware does when a new slot fails to boot. The page says it is NVIDIA firmware behavior.
Which key signs avocado deploy, how root.json reaches a device, and Connect-side behavior. The sideloading section says only what the device checks.
The code reading has not been reviewed by the avocadoctl maintainers.
filesystem-integrity.md still says dm-verity failure can trigger a reboot into a recovery partition; no such code exists in avocadoctl and the claim was not part of this change.
…doctl
The atomic update page promised automatic rollback on every device,
bootloader attempt counting, signatures validated before write, a
bootloader and device tree in each boot slot, delta compression and
power-loss detection. avocadoctl does none of the last two, verifies
streamed OS bundles only against the unsigned bundle.json, never reads
metadata expiry, and does not compare metadata versions. An integrator
planning a fleet around the old text would rely on protections that
are not in the code.
Rollback is a post-boot AVOCADO_OS_BUILD_ID check driven by per-board
manifest actions, and attempt counting exists only where a board's
bootloader environment implements it. Jetson manifests write only the
rootfs and boot kernel partitions. The pages now state each of these
as current behavior so an integrator can decide what to rely on.
…ture
The features overview promised that automatic rollback restores a
known-good state and that devices are never bricked, the filesystem
integrity page said a dm-verity failure falls back to the previous
slot on reboot, and the OS bundle page described streaming without
mentioning what it gives up. After the architecture page was
corrected, these three contradicted it and the code: avocadoctl rolls
back only from its post-boot build-id check, and streaming skips the
signed targets hash for the OS bundle.
Each page now states that trigger or that gap and links to the
architecture page instead of repeating its tables, so there is one
place to keep current.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The documentation overstates streaming artifact authentication and power-loss guarantees and omits initramfs verification from update success and rollback conditions.
This documentation-only PR aligns OTA verification and rollback guidance with avocadoctl behavior, replacing broad safety guarantees with update-path and board-specific limitations.
Changes:
Describes staged versus streaming verification, metadata limitations, and post-boot rollback checks.
Clarifies board-specific update artifacts and recovery behavior, removing unsupported delta-update and power-loss claims.
Updates related guides to explain sideload verification and provisioning-only var_files seeding.
The update architecture page described one set of board artifacts and
one attempt-counter example as if they held everywhere, but the 2024
(scarthgap) and 2026 (wrynose) meta-avocado manifests differ: 2024
writes no imx_boot, rootfs_hash or UKIs, several boards have no update
section at all and avocadoctl refuses their OS bundle, and the
bootloader fallback comes from three different mechanisms depending on
board and release. The post-boot check also omitted the initramfs
verification that avocadoctl runs, and named a field that does not
exist. The streaming paragraph called unsigned bundle.json hashes
authentication, and the power-loss list claimed a temporary file for
a path that has none.
The artifact table now has one column per release, a no-OS-update
note, and the rollback section names the U-Boot counter, systemd-boot
boot counting and one-shot BootNext with the boards that use each. The
two summary pages follow the same wording.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The security documentation conflates the signed bundle filename with the caller-controlled download origin and overstates power-cut safety by omitting the UEFI boot-order exception during streaming writes.
Signed metadata supplies the bundle filename, not its complete URL: the filename is derived from image_id, while the update API accepts a caller-supplied artifacts_url. Please distinguish the signed filename from the caller-controlled repository/artifact base URL so this security explanation does not imply that metadata authenticates the download origin.
…it action
The BootNext bullet said commit moves the new slot to the head of
BootOrder as if every efibootmgr board defined a commit action. The
Intel x86-64 manifests on scarthgap and the QEMU x86-64 manifest on
wrynose define none, and avocadoctl writes BootOrder only from a commit
action, so nothing writes it on those boards.
State the condition and name the two sets of manifests that define no
commit action, without saying what a reboot does there: that behavior
has been read in the source and not run on a board.
Signed-off-by: Javier Tia <javier@peridio.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human review is needed to assess the documentation’s reboot claim against the exception for bundles without rollback actions, where devices remain on the failed slot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The atomic update page says every device rolls back automatically, that the bootloader tracks boot attempts, that signatures are validated before write, that each boot slot holds the bootloader and device tree, and that Avocado supports delta compression and power-loss detection. The shipped code contradicts or does not implement each of these. Someone planning around the page would rely on protections that are not there, most visibly on Jetson (no device tree or bootloader in the slot, no attempt counter) and with
stream_os_to_partitionenabled.What changed
atomic-update-architecture.md: rewritten around what the code does.AVOCADO_OS_BUILD_IDcheck run byavocadoctl, with per-boardactivate,commitandrollbackactions.bundle.jsonhashes, default vsstream_os_to_partition. It states thatbundle.jsonis unsigned,expiresis never read, and metadata versions are not compared.sideloading.md: new "What the device checks" subsection.seeding-var.md: an OS update does not write the var partition, andavocadoctldoes not copyvar_files.features.md: the "Safe OTA with Automatic Rollback" text and the "No bricked devices" callout now say rollback is the post-bootAVOCADO_OS_BUILD_IDcheck, that attempt counting depends on the board's bootloader, that some boards ship no rollback actions, and that Jetson recovery from a slot that fails to boot depends on NVIDIA firmware. Links to the architecture page.filesystem-integrity.md: the dm-verity failure step no longer says reboot falls back to the previous slot;avocadoctlrolls back only on a failed post-boot build-id check (sole callersrc/commands/ext.rs:524, rollback atsrc/os_update.rs:573).update-process.md: "Streaming Mode" states the OS bundle is not compared to the signedtargetshash, is verified only by the unsignedbundle.jsonhashes, and that streaming is off by default (src/update.rs:303-305,:574-592;src/config.rs:42).stream_os_to_partitionis off by default, so the default path is verified against the signedtargetshashes. The page says so.Verified
prettier --checkon all six touched files: exit 0.npm --prefix src run buildfrom origin/main e3e0712: exit 0.main(d6e82f3). OnlyCONTRIBUTING.mddiffers fromv0.15.0, so these citations hold for the release.wrynose(2bdaf34) foros_artifacts,commitandrollback.Citations (avocadoctl v0.15.0):
src/update.rs:89-90. Signature checks before any download::107-153; ed25519 only::1107-1109.:649,:680-717.:303-305, piped toapply_os_update_streaming::574-592. Default off:src/config.rs:42.src/os_update.rs:2717-2750.bundle.jsoncarries no signature::2856-2885.expiresis read nowhere in the verification code:git grep -i expires -- srchits only test fixtures and display-only fields.perform_update(src/update.rs:69-300).src/os_update.rs:321,:534,:573. Post-boot check and reboot into the previous slot:src/commands/ext.rs:407-560.var_files, delta, power-loss, bootcount ormark-boot-successfulhandling:git grep -n -i 'var_files\|delta\|power.loss\|bootcount\|boot_tries\|mark-boot-successful' origin/main -- srcreturns no code hits.meta-avocado-nvidia/stone/stone-jetson-agx-orin.json:13-33. Attempt counter:stone-nanopi-r5s.json,stone-rzv2n-sr-som.json:21.Not verified
avocado deploy, howroot.jsonreaches a device, and Connect-side behavior. The sideloading section says only what the device checks.avocadoctlmaintainers.filesystem-integrity.mdstill says dm-verity failure can trigger a reboot into a recovery partition; no such code exists inavocadoctland the claim was not part of this change.