Skip to content

test(ipc): add malformed-envelope host gate (refs #586) - #735

Draft
rwrife wants to merge 2 commits into
mainfrom
fix/ipc-wire-malformed-harness-586
Draft

test(ipc): add malformed-envelope host gate (refs #586)#735
rwrife wants to merge 2 commits into
mainfrom
fix/ipc-wire-malformed-harness-586

Conversation

@rwrife

@rwrife rwrife commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • add tests/ipc_wire_malformed_test.c host fixture for v0 malformed-envelope rejection paths
  • add build/scripts/test_ipc_wire_malformed.sh and wire ipc_wire_malformed into build/scripts/test.sh
  • add ipc_wire_malformed to build/scripts/validate_bundle.sh TEST_TARGETS
  • cross-link docs/abi/ipc-wire.md to the new verification harness and refresh its ABI stamp

What this validates now

  • ipc_send(..., NULL) returns IPC_ERR_INVALID_MSG
  • abi_version mismatch returns IPC_ERR_INVALID_MSG
  • reserved flags (MBZ) violation returns IPC_ERR_INVALID_MSG
  • payload_len > IPC_MSG_PAYLOAD_MAX returns IPC_ERR_INVALID_MSG
  • delivered envelope with sender_subject == 0 is rejected by ipc_recv with IPC_ERR_INVALID_MSG
  • after each malformed rejection, the same port still supports a clean valid send/recv round-trip

Test evidence

  • bash build/scripts/test.sh ipc_wire_malformed
  • bash build/scripts/test.sh ipc_sync_v0
  • bash build/scripts/test.sh ipc_bounds
  • bash build/scripts/test.sh validate_abi_stamps ⚠️ pre-existing failure on docs/abi/manifest.md stamp drift (ABI_STAMP:FAIL:docs/abi/manifest.md:stamp=9d9ea25e85:last_content=e884cadd29), not introduced by this branch.

Follow-ups

The current v0 IPC surface is typed (ipc_msg_v0) and does not expose a raw byte-frame parser/opcode field, so truncated-header/underflow/unknown-opcode cases from #586 are not directly representable yet. This PR lands the currently enforceable malformed-contract slice and leaves raw-frame negative-path expansion for a follow-up once that surface exists.

Refs #586

rwrife added 2 commits July 30, 2026 21:03
- Add ipc_wire_malformed host fixture for v0 invalid-message branches
- Wire target into test.sh and validate_bundle TEST_TARGETS
- Cross-link docs/abi/ipc-wire.md to the new verification harness
@rwrife

rwrife commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

Maintenance refresh (2026-07-30): rebased this branch onto current origin/main by replaying only the implementation commits and dropping stale plans/secureos-daily-maintenance-state.md churn.\n\nRe-run evidence on refreshed head (7ac54a9):\n- bash build/scripts/test.sh ipc_wire_malformed\n- bash build/scripts/test.sh ipc_sync_v0\n- bash build/scripts/test.sh ipc_bounds\n- bash build/scripts/test.sh validate_abi_stamps\n\nAll pass locally.

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