fix(signing): keep repeated ELF signing idempotent - #339
Merged
Merged
Conversation
…336) `signELFFile` only checked bsign's signing exit code. Astra bsign 1.4.2 can return 0 after rewriting a file that immediately fails its own hash check, so a corrupt ELF shipped silently. After `bsign -N -s`, delivery-kit now runs `bsign -cE` and fails the build when the ELF-section hash does not pass. `-E` is required: without it bsign also probes absent xattr/detached stores and returns 64 even for a good ELF hash. Measured on the incident binaries: ``` pause_2: bsign -cE -> good hash, rc=0 pause: bsign -cE -> invalid hash, rc=66 ``` Exit 73 (non-zero unused signature-section bytes) now has a descriptive error instead of `unknown exit code`. That condition is intentionally build-fatal; bsign also cannot verify those files. Stub tests assert the exact ordered argv sequence and same path for signing/checking, plus failures 66 and 73. Package unit/vet pass. Related root-cause protections: deckhouse/delivery-kit-sdk#109 and deckhouse/elfedit#4. --------- Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com> (cherry picked from commit 5515529)
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
alexey-igrychev
pushed a commit
that referenced
this pull request
Sep 22, 2026
🤖 I have created a release *beep* *boop* --- ## [2.78.1-dk.2](v2.78.1-dk.1...v2.78.1-dk.2) (2026-09-22) ### Bug Fixes * **signing:** keep repeated ELF signing idempotent ([#339](#339)) ([f349dd2](f349dd2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Backport the ELF signing guards from #336 to the v2 line and update delivery-kit-sdk to v1.4.2.
Validation:
go mod verifygo test -count=1 -tags="dfrunsecurity dfrunnetwork dfrunmount dfssh containers_image_openpgp" ./pkg/build/signing/go vet -tags="dfrunsecurity dfrunnetwork dfrunmount dfssh containers_image_openpgp" ./pkg/build/signing/Prepared for review; do not merge automatically.