noCV
SMEM-103 · Establish the machine contract

Invalidate borrowed packet views when the arena resets

Practice briefStoryIntermediate

A decoder stores a view into the arena across reset and later reads bytes belonging to a different packet.

Focused work estimate
2h 30m + prerequisites
Priority in the scenario
Medium
Engineering practice
Lifetimes · Memory safety · Generations

Estimated field mix

  • Systems programming70%
  • Security30%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional telemetry collector copies decoded packet fields into a small native arena. The prototype misaligns wide values and reuses memory while readers still hold views. Create a local Rust crate or C library with generated byte fixtures; no device traffic or production allocator replacement is supplied.

Setup prerequisites

  • Pointers and slices
  • Integer overflow
  • Memory alignment

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Views carry the generation in which they were created
  • Reset advances generation before storage is reused
  • Stale view access fails deterministically in the safe API

Implementation constraints

  • Keep unsafe reads inside one reviewed boundary; do not claim runtime checks prove arbitrary raw pointers safe.

Verification to include

  • Read several current-generation views before reset.
  • Reset, reuse the same offset, and reject the older view.

Deliverables

  • Generation-bound view API and stale-view reproduction

Rollout and recovery

Migrate the decoder through the checked view API before enabling reset reuse.

Value of the work

For the engineer: Practice representation invariants, lifetimes, unsafe-boundary review and memory diagnostics.

For the team: Review a component whose allocation failures and corruption cases are explicit before reuse in latency-sensitive code.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.