Skip to content

Fail closed on unknown llama.cpp runtime hashes - #53

Draft
Blackspirits wants to merge 2 commits into
upl/review-base-9be1from
fix/llamacpp-runtime-failclosed-9be1
Draft

Blackspirits wants to merge 2 commits into
upl/review-base-9be1from
fix/llamacpp-runtime-failclosed-9be1

Conversation

@Blackspirits

@Blackspirits Blackspirits commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

llama.cpp engine archives and the separate Windows CUDA runtime archives are already checked against DownloadHashManager, but the integrity helper currently returns without verification when the key/digest cannot be resolved or when the stream is empty. That turns a future resolver/registry mismatch into an unauthenticated unpack.

This change:

  • fails closed when the llama.cpp engine/runtime hash key is missing
  • fails closed when the current digest is missing
  • rejects empty/tampered payloads instead of treating an empty stream as verified
  • rejects streams that cannot be safely read and rewound
  • always rewinds the stream after hashing, including failure/cancellation paths
  • preserves the existing release tag, URLs, registered digests, model-download behavior, variants and unpack flow
  • adds regressions for all 12 current engine/CUDA-runtime digests, the real HTTP engine-download path, null/unknown keys, empty streams and non-seekable streams

Validation

  • no URL or digest values were changed
  • all 12 current registry hashes were independently compared with the sha256: asset digests published by the official ggml-org/llama.cpp release b10840; all 12 match
  • current upstream still uses release tag b10840
  • dynamic GGUF model downloads are intentionally out of scope because they do not use this pinned release/hash registry
  • full solution restore passed
  • full solution build passed
  • full solution test suite passed on the first run
  • retry step was not used
  • validation run: #34704707527

Base is upstream 9be10e12d0f04655f2f134718b00679f89b2b15f.

This PR supersedes internal draft #44.

AI assistance: ChatGPT was used to independently re-audit the llama.cpp integrity path on current upstream, compare the current registry with official release asset digests, strengthen fail-closed verification, and add regression coverage.

Copy link
Copy Markdown
Owner Author

Independent adversarial re-check on current upstream base: confirmed all 12 current llama.cpp engine/CUDA-runtime registry hashes against the official ggml-org/llama.cpp b10840 release asset digests; no URL/hash values changed; null/unknown keys, empty streams and non-seekable streams now fail closed before unpack; tampered bytes are rejected and the stream is rewound. Full current-base CI run #34704707527 passed on the first test run with no retry. No blocker identified. Keep draft; no merge/promotion performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant