Skip to content

Embedded: no_std on-target verifier + signed WCMC/size manifest for the kiln on-board interpreter trust chain #187

Description

@avrabe

Context

kiln is bounding how much memory an arbitrary wasm can consume for fixed-RAM embedded (gale/gust) — decision: pulseengine/kiln#415, AD-WCMC-001. scry (sound abstract interpretation, DO-333) computes the hard half (shadow-stack / longest-path bounds); those bounds go into kiln's kiln.resource_limits custom section.

The catch: scry runs host-side and cannot run on the embedded target, so the target can't recompute the bounds — it must trust signed ones and verify them on-target. sigil is the natural fit (embedded signatures, offline verification, already has "verify image size before signing" precedent). But two adjustments are needed:

Ask

  1. A no_std sigil verifier library for on-target verification. sigil is std-only today (no #![no_std] anywhere), so sigil verify is a host CLI. The embedded interpreter (on thumbv7em-none-eabi, gale/gust) needs a no_std verify lib it can call to check a module's embedded signature offline, on the target, before admitting it. This mirrors kiln's own no_std push (kiln-async already ships a thumbv7em staticlib).

  2. The WCMC / resource-limits manifest must be a SIGNED field of the attestation — not an unsigned custom section. So the size bounds (max_memory_usage, max_call_depth, shadow-stack bound, table/global sizes) are covered by the signature, and the target can trust them for reject-at-load (refuse a module whose signed bounds exceed the provisioned RAM/stack budget).

  3. Key-based offline verification for the embedded profile — sigil's own recorded residual is "offline keyless verification impossible" (Sigstore/keyless needs network), so air-gapped gale/gust must verify with embedded public keys, not keyless.

Why it matters

Without on-target verification, reject-at-load would key off an unsigned size claim in the module — trivially forgeable. The whole point (moving a fixed-RAM overrun from "mid-mission trap in the field" to "integration failure on the bench") only holds if the target trusts the bound. sigil is what makes the bound trustworthy.

Coordination

Planning/coordination; kiln-side tracked in kiln#415 / AD-WCMC-001. The pipeline: meld → scry (bounds) → kiln.resource_limits → sigil signs → embedded verifies (no_std, offline, key-based) → reject-at-load → run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions