fix(daemon): answer the client when its binary image is rejected (#1383) - #1439
Merged
Conversation
An image-verification rejection logged daemon.client_image_rejected and finished the worker WITHOUT sending a hello response - the only admission-failure path that never answered the peer. The client reported status "pending" indefinitely, indistinguishable from a slow cold start, with the reason visible only in the daemon log. The rejection now sends a CONNECT_REJECTED hello response carrying the reason (fingerprint_mismatch / image_unverifiable) and an actionable message, matching the version-conflict and capacity paths. The version-conflict path already responds to unverified peers, so this discloses nothing new to a same-uid local peer; admission stays rejected either way. Adds a CBM_ENABLE_TEST_SEAMS-only seam forcing peer-image verification to fail, since the in-process harness's peer pid is OS-authenticated socket credentials and always verifies against the service's own active image. Test: daemon_runtime_image_rejection_reaches_client_issue1383 - the client receives CONNECT_REJECTED with the reason in the message. RED without the response block (client times out), GREEN with it. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
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.
Part of #1383 (the client-hang half).
Root cause
The image-verification rejection was the only admission-failure path that never sent a hello response — version conflicts and capacity rejections both answer the peer. The client sat on
status: "pending"indefinitely, indistinguishable from a slow cold start, withdaemon.client_image_rejectedvisible only in the daemon log.Fix
The rejection now sends a
CONNECT_REJECTEDhello response carrying the reason (fingerprint_mismatch/image_unverifiable) and an actionable message, in the same style as the cache-dir conflict message the reporter praised. Security posture unchanged: the version-conflict path already responds to unverified same-uid peers before image verification, and admission stays rejected either way.Adds a
CBM_ENABLE_TEST_SEAMS-only seam forcing peer-image verification to fail — the in-process harness's peer pid is OS-authenticated socket credentials, so the rejection path was untestable without it.Verification
daemon_runtime_image_rejection_reaches_client_issue1383: client receivesCONNECT_REJECTEDwith the reason in the message. RED without the response block (client times out inCONNECT_ERROR— the pending-forever symptom), GREEN with it.daemon_runtime+daemon_ipc+daemon: 102 passed.lint-ciclean.Not in this PR
Why the reporter's Linux 6.x box failed to fingerprint a byte-identical peer at all (
image_unverifiablefrom/proc/<pid>/exeacquire) — content-based admission of byte-identical binaries is already the implemented model, so their case should have been admitted. Needs reporter environment data; follow-up question going on the issue.