Skip to content

feat(ipsec-xfrm): supervise cancellation-safe single-object installs #409

Description

@VerifiedOrganic

Problem

PR #403 adds a cancellation-safe staged journal for the SA-plus-policy composite. Consumers also have legitimate single-object XFRM install operations:

  • an SA-only install when a new SA intentionally reuses an existing shared policy; and
  • an additional policy-only install when one SA requires more than one policy direction.

Calling XfrmBackend::install_sa or install_policy directly inside a cancellable consumer future preserves the same ambiguity addressed by #402: after issue but before the result is observed, the consumer cannot know whether it owns an applied object. Pre-registering intent as cleanup authority can delete a pre-existing object after AlreadyExists; registering only after success can leak an acquired object on cancellation.

XfrmStagedInstall cannot safely represent either operation without inventing a duplicate or dummy companion mutation. Consumers must not infer kernel ownership from call order or process-local intent.

Requested SDK boundary

Provide an additive cancellation-safe staged boundary for exact SA-only and policy-only installs, or generalize the landed journal so one typed operation can be supervised independently.

The boundary should preserve the properties of PR #403:

  • affine one-run execution with caller-retained journal state;
  • owned worker supervision after first poll;
  • explicit issued, acknowledged, rejected, indeterminate, committed, recovered, and supervision-lost states;
  • generation-bound classified recovery under caller-held writer exclusion;
  • exact object identity without broadened deletion authority; and
  • redaction-safe outcome, error, and debug surfaces.

Acceptance tests

  • Dropping an unpolled staged SA-only or policy-only install performs no mutation.
  • Dropping the observer after issue leaves the owned worker and claim live until the backend result is observed.
  • AlreadyExists authorizes no removal of the pre-existing object.
  • Acknowledged acquisition can be committed to product ownership.
  • StateIndeterminate requires explicit classified readback before recovery.
  • Recovery removes only an exact object classified as owned; Absent and Foreign never trigger deletion.
  • Dropping recovery does not release the claim while removal remains live.
  • Runtime or worker loss permanently blocks in-process commit/recovery until a fresh process re-establishes exclusion and readback.
  • All public formatting remains free of keys, addresses, selectors, and SPIs.

Context

Observed against SDK main at 4c70b1fedd4d26e7c5e181f57a64e4048957abce. This is a generic operation-ownership gap and contains no subscriber, endpoint, key, SPI, credential, or production-network value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestepdgRequired by the ePDG product integrationrustPull requests that update rust codestatus: in progressImplementation underway; check linked branches and PRs before overlapping work.status: ready for reviewImplementation PR open and awaiting peer review.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions