[BUG] Malformed materialization reply preserves a success error code #4

Closed
opened 2026-09-24 22:38:36 +02:00 by erikinkinen · 1 comment
Owner

Summary

Loaderd's materialization reply helper returns an error carrying result code OK when its transport reports OK with a response length other than the required 36 bytes. The graph path still enters failure cleanup, but its error status contradicts the failure and can prevent a canonical failure reply.

Reproduction

At Loaderd 490438e17be2b299f0f62e5803a00a9a82c0c3c9, inspect call_materialization in src/handoff.rs. Supply a transport result Ok((IPC_RESULT_OK, 35)) or Ok((IPC_RESULT_OK, 37)). The wrong-length branch constructs HandoffError::handoff(transport_result), therefore its result_code is zero. This is a deterministic source-level reproducer; the new whole-graph regression controls are written but have not yet run against the coherent successor dependencies.

Expected and actual behavior

Expected: malformed success framing produces a nonzero protocol failure, and the original active materialization is retained through acknowledged abort. Existing nonzero transport failures remain lossless.

Actual: the helper returns Err with result_code == IPC_RESULT_OK. This report does not claim that malformed output was observed in a guest or that cleanup was bypassed.

Environment and identity

  • Component: Loaderd 490438e17be2b299f0f62e5803a00a9a82c0c3c9, feature/posix-compat.
  • Image/runtime: source review; no new image or guest result.
  • Target: native x86_64 materialization client; host fault controls are pending.
  • Authority: existing Loaderd-to-Procd materialization route and original transaction; no added capability.
  • Last known working revision: unknown.

Evidence and prior checks

Independent inspection found the wrong-length branch while reviewing the new authenticated realm-layout binding. The correction maps only an OK transport status with invalid framing to INTERNAL. Controls cover short and oversized OK replies through the actual graph handoff, exact original transaction abort, linker abort and scratch erasure. Source, strict local checks and original CI remain pending before correction acceptance; no failed input has been rerun to claim success.

Tracking

Related: Loaderd authority and quality work, realm lifecycle, and the phase completion record. Keep this issue open until the corrected source, fault controls and required validation are recorded.

## Summary Loaderd's materialization reply helper returns an error carrying result code OK when its transport reports OK with a response length other than the required 36 bytes. The graph path still enters failure cleanup, but its error status contradicts the failure and can prevent a canonical failure reply. ## Reproduction At Loaderd `490438e17be2b299f0f62e5803a00a9a82c0c3c9`, inspect `call_materialization` in `src/handoff.rs`. Supply a transport result `Ok((IPC_RESULT_OK, 35))` or `Ok((IPC_RESULT_OK, 37))`. The wrong-length branch constructs `HandoffError::handoff(transport_result)`, therefore its `result_code` is zero. This is a deterministic source-level reproducer; the new whole-graph regression controls are written but have not yet run against the coherent successor dependencies. ## Expected and actual behavior Expected: malformed success framing produces a nonzero protocol failure, and the original active materialization is retained through acknowledged abort. Existing nonzero transport failures remain lossless. Actual: the helper returns `Err` with `result_code == IPC_RESULT_OK`. This report does not claim that malformed output was observed in a guest or that cleanup was bypassed. ## Environment and identity - Component: Loaderd `490438e17be2b299f0f62e5803a00a9a82c0c3c9`, `feature/posix-compat`. - Image/runtime: source review; no new image or guest result. - Target: native x86_64 materialization client; host fault controls are pending. - Authority: existing Loaderd-to-Procd materialization route and original transaction; no added capability. - Last known working revision: unknown. ## Evidence and prior checks Independent inspection found the wrong-length branch while reviewing the new authenticated realm-layout binding. The correction maps only an OK transport status with invalid framing to INTERNAL. Controls cover short and oversized OK replies through the actual graph handoff, exact original transaction abort, linker abort and scratch erasure. Source, strict local checks and original CI remain pending before correction acceptance; no failed input has been rerun to claim success. ## Tracking Related: [Loaderd authority and quality work](https://git.erikinkinen.fi/erix/loaderd/issues/1), [realm lifecycle](https://git.erikinkinen.fi/erix/posixd/issues/1), and the [phase completion record](https://git.erikinkinen.fi/erix/integration/issues/65). Keep this issue open until the corrected source, fault controls and required validation are recorded.
Author
Owner

Fixed in e3e3d192. Wrong-length replies carrying OK now produce INTERNAL; existing nonzero transport errors are preserved. The graph regression exercises short and oversized replies, verifies abort of the original transaction and linker work, and checks scratch erasure. It passes in the complete warning-free run 286, alongside all 163 unit tests. Closing the reported reply-framing defect.

Fixed in [e3e3d192](https://git.erikinkinen.fi/erix/loaderd/commit/e3e3d1925cfd0c58b2dd6c8344883d5afa9b9f05). Wrong-length replies carrying OK now produce INTERNAL; existing nonzero transport errors are preserved. The graph regression exercises short and oversized replies, verifies abort of the original transaction and linker work, and checks scratch erasure. It passes in the complete warning-free [run 286](https://git.erikinkinen.fi/erix/loaderd/actions/runs/286), alongside all 163 unit tests. Closing the reported reply-framing defect.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:01 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/loaderd#4
No description provided.