* fix(limits): report a limit requirement only when the reader knows it
OCI image layouts, SWF movies, Zstandard frame walks, LZMA streams without
a declared size, XAR TOCs, cpio archives and VSIX/NuGet metadata members
stopped at the first excess and reported that stopping counter or running
sum as the requirement. Raising the limit to it failed again one step later.
None of those inputs declares a total before the stop, so the refusal now
leaves the requirement unknown. A declared size or count (ZIP member sizes,
the ZIP entry total, SWF FileLength, an LZMA declared size) is still
reported, and VSIX/NuGet now pass every such requirement as required_value
instead of only those above the control's maximum.
Fixes#15647
* test(oci): assert descriptor limits report no requirement
Scheduled full CI runs fail Deep static checks on Knip: dead type aliases
(InspectEspNvsInput, InspectEspNvsRequest, VectorEntryNameBasis,
LabviewArtifactVersionCoverage), module-local constants exported under a
second name (LZMA1_PROPERTIES_BYTES, IMAGE4_MAX_DECODED_PRIMITIVE_BYTES)
and a schema alias (firmwareVectorTablePageContextSchema). Remove them.
decodeLzma1KnownSize is loaded by URL from the LZMA worker and is marked
@public; the checkpoint wait floor keeps its own name for the numeric limit
verifier and is marked @alias.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(uefi): decode LZMA sections through one shared LZMA1 owner
UEFI LZMA custom sections whose header declared a dictionary above 64 MiB
were refused as an output limit even when their output was tiny, because the
worker compared the dictionary with the output budget and handed it to
lzma-purejs, which allocates a window of that size. EDK II's one-call
LzmaDecode uses its output buffer as the dictionary, so a valid stream never
needs more window than its output.
src/compression/Lzma1.ts now owns LZMA1 for UEFI and UnityFS: the
LZMA-Alone header and LZMA1 property bounds (lc 0-8, lp 0-4, pb 0-4), the
range coder lead-in, a decoder window of max(4 KiB, min(dictionary, output
bound)), bounded output, and the verdict on a stream. Lzma1Header.ts reads the
header fields with BinaryReader at the host boundary. The UEFI worker keeps
its framing, x86 branch filter and reply protocol; a corrupt stream or invalid
properties are now reported as malformed rather than as a decoder fault. The
UnityFS worker thread loads the same module instead of an inline decoder.
Closes#14917
* fix(compression): leave LZMA1 host faults to their host
decodeLzma1Alone reported every exception from the codec as a malformed stream, so an allocation failure or codec defect inside the decoding host looked like corrupt input, and the codec's own verdict text was lost. Only lzma-purejs's verdict literals ("Error in data stream", "Incorrect stream properties") are now a malformed verdict; anything else is rethrown for the host to classify (UEFI reports it as a decoder fault, the UnityFS worker as a runtime failure).
* feat(artifacts): decode UnityFS LZMA blocks
Unity's default AssetBundle compression (type 1) left members as
hash_status unavailable. Decode 5-byte Unity LZMA streams with the
existing lzma-purejs dependency so inventory can hash and extract them.
* fix(compression): read Unity LZMA dictionary via BinaryReader
Architecture guards forbid raw Buffer numeric reads outside
binaryContainer; match the UEFI LZMA path.
* style(compression): format UnityFS LZMA helper
* fix(compression): make UnityFS LZMA cancelable and end-marker safe
Accept optional LZMA end markers without trailing junk, decode off-thread so
timer aborts land, return one expected-sized buffer, and mark xinzexi unverified.
* fix(compression): await Unity LZMA worker exit and transfer alone buffer
Await worker.terminate() before settling abort/reply paths, and allocate the
synthesized alone header with allocUnsafeSlow so the worker receives it without
a second encoded-stream copy.
* chore: retrigger CI after Greptile worker-exit follow-up
* test(compression): clarify Unity LZMA cancellation case title
Retriggers Actions after the worker-exit follow-up push did not receive a
GitHub Actions check suite.
* fix(unityfs): keep the directory for over-budget LZMA blocks and decode spec-valid streams
UnityFS writers emit one LZMA block for a whole data stream, so the per-block
decode budget refused the whole inventory of any LZMA bundle above 64 MiB,
where before this change the directory was retained. An over-budget block now
keeps the directory and only members inside it report an unavailable read
naming the budget, for LZ4 and LZMA alike.
The LZMA decoder window is bounded by the declared output instead of the
declared dictionary, so a large dictionary on a small block decodes and no
longer allocates a dictionary-sized window. Properties follow the LZMA
specification (lc 0-8, lp 0-4, pb 0-4) rather than the LZMA2 lc + lp limit.
Worker error events and exits without a reply stay runtime failures instead of
being reported as a malformed block.
Tests decode a liblzma-produced stream as a known answer, settle only after
the worker exits on completion and cancellation, and share one encoder.
* fix(artifacts): report Unity LZMA size mismatch as malformed
Overflow past the bundle's declared length is a format error, not a
decoder budget exhaustion. Declarations above maximumBytes still fail
closed as a resource limit before decode starts.
* fix(unityfs): name the encoded or decoded bound that refused a block
A block refused by its encoded size reported its decoded size against the decoded budget. The block now records which bound refused it, and the member read names that bound, its declared size and the budget.
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
Share selected-file errno ownership with model inspection and codec result accounting with Rust. Verify actual descriptor exhaustion and unchanged-input recovery in an isolated child.
Fixes#6666