Repository navigation
fix(artifacts): keep uImage coverage unknown when bytes follow the declared payload - #14896
Merged
vincentkoc merged 1 commit intoNov 27, 2026
Merged
Conversation
…clared payload U-Boot does not pad a legacy image, so bytes after the 64-byte header and the declared payload belong to no entry. The reader reported complete coverage for them, which hid a root filesystem appended after a kernel. Report unknown coverage with the length and starting offset of those bytes. Fixes morluto#14893
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
[Medium impact] The PR appears safe to merge. SummaryThe PR marks uImage coverage as
Reviews (2) · Last reviewed commit: "fix(artifacts): keep uImage coverage unk..." · Reviewed by Greptile |
Collaborator
|
Thanks! Merged with the trailing-byte regression and exact-length control, after clean CI and review. |
vincentkoc
added a commit
that referenced
this pull request
Nov 27, 2026
…pgp-633-20261127 * commit '3097263763611eb0c32c502d5a222060cf02f468': fix(cli): describe universal Mach-O slice selection without a single-dash flag (#14912) fix(iso9660): read Joliet trees whose .. records name their own directory (#14817) feat(gpu)!: add per-call object, work, report, metadata, structure, and parser budgets to inspect_gpu_code_objects (#14882) fix(macho)!: select arm64e.x1 slices of universal Mach-O files by exact subtype (#14881) refactor(views): share bounded parent and report limitations (#14902) refactor(desktop): share XML parent pointers in task drafts (#14905) feat(ghidra): define function-pointer members and typedefs (#14889) refactor(setup): share publication destination checks (#14904) perf(ci): skip unused test runtime uploads (#14903) fix(nuget): preserve explicitly spaced publisher metadata (#14906) fix(artifacts): keep uImage coverage unknown when bytes follow the declared payload (#14896) fix(artifacts): report incomplete Android sparse coverage (#14883) fix(tar): require both end-of-archive blocks for complete coverage (#14884) refactor(views): centralize indexed row paging (#14878) refactor(views): reuse optional filters in report projections (#14877)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The U-Boot legacy uImage reader reported
coverage.status: "complete"when the file continued past the declared image (64-byte header plusih_size). Those bytes belong to no entry and no limitation mentioned them. That is the layout of OpenWrt sysupgrade images, where a squashfs root filesystem follows the kernel uImage. After this change, coverage isunknown, with a limitation giving the length and starting offset of the bytes that were not exposed. Entries, metadata and CRC checks are unchanged.Fixes #14893
Problem and expected behavior
Smallest trigger: a valid uImage with any bytes appended after its payload. On
dc12e5768bit lists.andpayload.binwithcompletecoverage.Real example: OpenWrt 24.10.0
glinet_gl-ar150-squashfs-sysupgrade.bin(published SHA-256594bf0fb…ae2d13b) is 6,619,452 bytes. The uImage ends at offset 2,613,261, so 4,006,191 bytes (the rootfs) were hidden behind acompleteinventory.The artifact inventory contract treats complete coverage as every byte accounted for. ZIP reports bytes its central directory does not account for as
unknown, and the ESP image reader does the same for undescribed trailing bytes.Change and scope
UImageArtifactReaderderives coverage in a newuImageCoveragehelper. Coverage isunknownif the size table failed to parse (existing behavior) or if the file has bytes past64 + ih_size. The helper also builds both limitations, which keepsprepareEntriesunder the lint function-length limit.mkimagewrites header plus data), so no padding allowance is needed. Partition dumps padded with0xffalso reportunknown, because REA does not examine or expose those bytes.docs/uimage.mdstates where the image ends and when coverage is unknown.Not included:
mkimage -Epads the last external image up to its alignment (-Bblock size), so FIT needs a padding rule first; this is noted in [Bug] uImage inventory reports complete coverage when bytes follow the declared payload #14893.Contribution scope: not applicable (fix within an existing reader).
Contract and boundary impact
UImageArtifactReader.prepareEntries, which already owns the header facts and the carrier size.complete; after, it isunknown. An exact-length uImage stayscomplete.inspect-artifact/inspect_artifactandextract-artifactreportcoverage.status: "unknown"for these files.unknown, with one added limitation.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
UImageArtifactReader.test.tsadds "keeps coverage unknown when bytes follow the declared payload". ThroughscanCanonicalArtifactInventory, it asserts the exposed child,unknowncoverage and the exact limitation. The existing kernel test is the exact-length control and still assertscomplete.sha256sums):coverage.statusinitramfs-kernel.bin(6,240,763 bytes, exact uImage)completecompletesquashfs-sysupgrade.bin(6,619,452 bytes)completeunknownAdded limitation on the sysupgrade image:
4006191 byte(s) after the uImage payload, starting at offset 2613261, were not exposed as entries.Boundary regressions: an unexposed region after the declared extent, an exact-length control, and the existing truncation, CRC and size-table failure paths. No lifecycle stage changes.
For evidence-bearing changes:
Validation performed
npx vitest run src/artifacts: 109 files, 2393 tests pass, 19 skipped.npx vitest runonUImageArtifactReader.test.ts,UImageArtifactReader.boundaries.test.ts,tests/boundary/mcp/uImageMcp.test.ts,tests/acceptance/uImageCli.test.ts,OwnedArtifactStream.test.ts,artifactFormatRecognition.test.ts,machoContainer.test.ts,TargetFormatVocabularies.test.tsanddfuse.test.tsafternpm run build: all pass.npx vitest run src/artifacts/UImageArtifactReader.test.tswith the reader change reverted: 1 failed (the new test), 16 passed.node scripts/run-typescript.mjs -p tsconfig.json --noEmit: passes.npx oxfmt --checkon the changed files: passes.npx oxlinton the changed files: no warnings.node scripts/verify/architecture-guards.mjs: passes.npm run verify:module-boundaries: passes.npm run docs:check: passes.rea inspect-artifact <file> --jsonon the two OpenWrt images, on the base revision and with the change: results as in the table above.Compatibility, safety, and release
completefor these files now seeunknown, which the contract already allows.Author readiness
Human owner: @Anurag-5ingh
Author checklist (completed by the PR author before requesting review)
type(scope): outcome.REA_runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.