[BUG] Pipeline write overflow mutates retained bytes before refusal #15
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/launchd#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Launchd's retained pipeline writer appends accepted bytes before checking whether its cumulative write offset can represent them. At the u64 offset boundary, a rejected write can therefore change queued content while preserving the old offset. The source review found this during original stream metadata work; no runtime reproduction or practical route to that cumulative byte count is claimed.
Reproduction
Source-derived unit reproduction: create a one-byte-capacity native pipeline with its exact authenticated writer and reader, seed its retained cumulative write/read offsets at
u64::MAX, then submit a one-byte write at that offset. Inspect the same original queue and offsets afterLaunchStreamStateError::Overflow. A new focused control will retain this boundary without sending 2^64 bytes. It is authored but will remain unrun under the current testing waiver.Expected and actual behavior
Expected: complete arithmetic admission before any byte, lifecycle, timestamp or offset changes; the overflow result preserves the entire prior object.
Actual source order:
append_byteschanges the arena andbyte_len, thenchecked_addfails. The error leaves the appended byte alongside the old cumulative offset. The fix moves offset and response-count conversion before the first append.Environment and identity
0f1997119add18d48c2db41fc209c2798a63b3a0,src/stream_state_io.rs::apply_write_request.c0e56fac9e2322bc61b8cbc991752f4502640606.Evidence and prior checks
The selected revision contains
append_bytes(index, &request.data[..accepted])?beforewrite_offset.checked_add(accepted_u64). The direct retained-state control will assert an empty unchanged queue, unchanged full-width offsets and no timestamp query on refusal. Tests, builds and CI observation remain deferred; this issue does not claim an executed failure or pass.Tracking
Related original-source status feature, Launchd feature review and phase completion.
Original native stream event times — 30 September 2026
Alias creation, metadata queries, empty or refused operations and terminal device progress do not query a historical clock.
Ttyd receives an exact authenticated SEND-only Timed endpoint for this source purpose; Launchd uses its already admitted endpoint. Clean refusal remains Unknown.
The seeded boundary control retains the whole original object and proves the intended no-clock refusal contract when executed; no runtime reproduction or practical path to 2^64 bytes is claimed.
They cover source-event independence, unknown evidence, full-range dates, malformed replies, receipt cleanup, exact SEND-only admission, alias/retirement/reuse and overflow refusal. The existing realm workload now requires successful inherited fstat and original PTY clock evidence with stable birth before and after realm retirement; its independent transcript remains 385 calls.
The full status/directory feature remains open for complete FAT metadata and whole-feature integration. Both full EriX guest build generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed.
Related records and contracts
erikinkinen referenced this issue from erix/posixd2026-09-30 21:20:30 +02:00
erikinkinen referenced this issue from erix/coreutils2026-09-30 21:21:49 +02:00
erikinkinen referenced this issue from erix/docs2026-09-30 21:22:01 +02:00
erikinkinen referenced this issue from erix/e2fsd2026-09-30 21:22:09 +02:00
erikinkinen referenced this issue from erix/exsh2026-09-30 21:22:10 +02:00
erikinkinen referenced this issue from erix/extop2026-09-30 21:22:11 +02:00
erikinkinen referenced this issue from erix/fatd2026-09-30 21:22:12 +02:00
erikinkinen referenced this issue from erix/integration2026-09-30 21:22:17 +02:00
erikinkinen referenced this issue2026-09-30 21:22:22 +02:00
erikinkinen referenced this issue from erix/lib-ipc2026-09-30 21:22:29 +02:00
erikinkinen referenced this issue from erix/lib-posixabi2026-09-30 21:22:30 +02:00
erikinkinen referenced this issue from erix/lib-stdio2026-09-30 21:22:32 +02:00
erikinkinen referenced this issue from erix/loaderd2026-09-30 21:22:35 +02:00
erikinkinen referenced this issue from erix/posixd2026-09-30 21:22:38 +02:00
erikinkinen referenced this issue from erix/procd2026-09-30 21:22:39 +02:00
erikinkinen referenced this issue from erix/ramfsd2026-09-30 21:22:40 +02:00
erikinkinen referenced this issue from erix/rootd2026-09-30 21:22:41 +02:00
erikinkinen referenced this issue from erix/timed2026-09-30 21:22:42 +02:00
erikinkinen referenced this issue from erix/ttyd2026-09-30 21:22:42 +02:00
erikinkinen referenced this issue from erix/vfsd2026-09-30 21:22:43 +02:00