[BUG] Enforce the compatibility offset maximum before file effects #23

Closed
opened 2026-09-30 09:00:22 +02:00 by erikinkinen · 0 comments
Owner

Summary

Regular-file compatibility I/O bounds positions by the native unsigned domain instead of the signed offset maximum of its open description. Atomic append cannot carry that maximum to the provider, so a write can commit bytes beyond the compatibility representation before its cursor is checked.

Reproduction

Source-derived, not executed: admit a regular file whose current EOF is at the signed 64-bit offset maximum, select APPEND, and issue a nonempty Write. The same missing boundary affects a read starting at the maximum before a larger native file's EOF. The newly authored seek/positioned operations make the boundary directly expressible too.

Expected and actual behavior

Expected: no transfer crosses the description's offset maximum. A boundary-crossing transfer can commit its representable prefix; a positive write starting at the maximum reports EFBIG without an effect. A positive read at the maximum reports EOVERFLOW only when before actual EOF, otherwise EOF. Empty I/O retains its normal access checks.

Actual source path: compatibility file admission clips only against u64::MAX, and the provider write family carries no caller-specific end limit. A separate size query cannot fix atomic append because another writer may change EOF between calls. No oversized fixture or runtime execution was used for this report.

Environment and identity

  • Component revision: Posixd 85efb7f9, coordinated feature branch.
  • Image/runtime configuration: source inspection only; no image generated or executed.
  • Architecture/toolchain: x86_64 compatibility signed file offsets over full-width native file positions; no measured toolchain result.
  • Authority: the existing original admitted file and provider route; an arithmetic limit must never confer or widen authority.
  • Last known working revision: not established.

Evidence and prior checks

The actual file-admission path subtracts the retained position from u64::MAX. Native and private candidate-write bodies contain position, append and data but no end limit. Follow the primary read and write offset-maximum contracts. Tests, builds and CI observation are deferred by user instruction.

Tracking

The positioned/vector I/O and shared-seeking implementation is signed and published: lib-ipc 727b1470, lib-posixabi ddc59f2c, posixd 1fd58a05, vfsd 020e9feb, e2fsd a9b91e44, ramfsd 03bea99f, fatd 8ab6df60, integration e0c9cfc1, docs 2c521015. Complete file I/O remains open for actual signal interruption and blocking/wait integration. Checkpoint publication does not accept that unfinished runtime scope.

Compatibility1.8 defines exact positioned/vector/seek families, checked borrowed vector sums and signed positions. Pread/Pwrite preserve the shared cursor; Pwrite ignores APPEND. One gathered prefix preserves native append atomicity. Fresh END/DATA/HOLE size comes from the same live admitted candidate and original provider object, including write-only descriptions, without new read authority or path reopening. Streams/channels retain nonblocking behavior and reject positioning. Access checks precede empty I/O.

Disjoint candidate-write version two replaces the superseded API and carries an explicit full-width end limit. Ext/RAM choose EOF, clip the prefix and write in one exclusive turn. Signed boundary writes report EFBIG before effects; boundary reads distinguish EOVERFLOW before EOF from actual EOF. Positive result correlation checks the limit, while zero progress preserves content, timestamps and the shared cursor. Native callers retain their own full-width limits.

Canonical correlated BUSY/RETRY without progress preserves the original fd for a later new call. Malformed/lost/uncertain results retain cleanup-only custody; refused completion never replays an effect. This fixes VFS transient admission, Posixd transient admission and signed offset maxima. The reports use the bug template and remain source-derived, without executed reproduction claims.

Thirty-seven new unit controls are authored and unrun: seven compatibility codec, five IPC codec, two ext, two RAM, two FAT/exFAT, five VFS and fourteen Posixd file/stream/channel controls. The native realm workload covers positioned cursor preservation, append independence, gathered/scattered bytes, shared seeks, fresh EOF after an independent writer and sparse growth. Original native authority and exit/deadline gates are preserved.

Current phase progress is 17.04% weighted and 5.61% whole-item acceptance: 22/460 parents and 442/902 sub-items. Actual signal delivery and blocking waits remain unfinished; transport failure or caller disappearance never fabricates EINTR. Both full EriX guest-build generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed.

Repair within complete positioned/vectored I/O. Replace the candidate-write wire family with a disjoint version carrying an explicit full-width end limit, enforced atomically with EOF selection inside the provider. Retire the superseded API and update every producer/consumer together. Preserve native callers' ability to select their own representable maximum. Track overall work in Integration.

## Summary Regular-file compatibility I/O bounds positions by the native unsigned domain instead of the signed offset maximum of its open description. Atomic append cannot carry that maximum to the provider, so a write can commit bytes beyond the compatibility representation before its cursor is checked. ## Reproduction Source-derived, not executed: admit a regular file whose current EOF is at the signed 64-bit offset maximum, select APPEND, and issue a nonempty Write. The same missing boundary affects a read starting at the maximum before a larger native file's EOF. The newly authored seek/positioned operations make the boundary directly expressible too. ## Expected and actual behavior Expected: no transfer crosses the description's offset maximum. A boundary-crossing transfer can commit its representable prefix; a positive write starting at the maximum reports EFBIG without an effect. A positive read at the maximum reports EOVERFLOW only when before actual EOF, otherwise EOF. Empty I/O retains its normal access checks. Actual source path: compatibility file admission clips only against u64::MAX, and the provider write family carries no caller-specific end limit. A separate size query cannot fix atomic append because another writer may change EOF between calls. No oversized fixture or runtime execution was used for this report. ## Environment and identity - Component revision: [Posixd `85efb7f9`](https://git.erikinkinen.fi/erix/posixd/commit/85efb7f985c04a737b147689bd7a6126b94a1817), coordinated feature branch. - Image/runtime configuration: source inspection only; no image generated or executed. - Architecture/toolchain: x86_64 compatibility signed file offsets over full-width native file positions; no measured toolchain result. - Authority: the existing original admitted file and provider route; an arithmetic limit must never confer or widen authority. - Last known working revision: not established. ## Evidence and prior checks The actual file-admission path subtracts the retained position from u64::MAX. Native and private candidate-write bodies contain position, append and data but no end limit. Follow the primary [read](https://pubs.opengroup.org/onlinepubs/9799919799/functions/read.html) and [write](https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html) offset-maximum contracts. Tests, builds and CI observation are deferred by user instruction. ## Tracking The positioned/vector I/O and shared-seeking implementation is signed and published: [lib-ipc `727b1470`](https://git.erikinkinen.fi/erix/lib-ipc/commit/727b1470944d7e53d93abd01a336e24f2144a62c), [lib-posixabi `ddc59f2c`](https://git.erikinkinen.fi/erix/lib-posixabi/commit/ddc59f2cf203df14949eb76a9a9524366a2fcb3e), [posixd `1fd58a05`](https://git.erikinkinen.fi/erix/posixd/commit/1fd58a05683e6541a908c546118eadd4a13cd964), [vfsd `020e9feb`](https://git.erikinkinen.fi/erix/vfsd/commit/020e9feb742c8e6830a56acf537f45001dd9b8cf), [e2fsd `a9b91e44`](https://git.erikinkinen.fi/erix/e2fsd/commit/a9b91e4452271d668f5007de2481836f0d54b90f), [ramfsd `03bea99f`](https://git.erikinkinen.fi/erix/ramfsd/commit/03bea99f2686934a3f516127f12ce9f1b2a07b24), [fatd `8ab6df60`](https://git.erikinkinen.fi/erix/fatd/commit/8ab6df60a03d0d9fdd33186ccc9b91654ed98ef1), [integration `e0c9cfc1`](https://git.erikinkinen.fi/erix/integration/commit/e0c9cfc1afe397c8415fee4487f14ff7fcd04567), [docs `2c521015`](https://git.erikinkinen.fi/erix/docs/commit/2c52101537a11d7991942e2a8d1c3cdf7f7a6e48). [Complete file I/O](https://git.erikinkinen.fi/erix/posixd/issues/21) remains open for actual signal interruption and blocking/wait integration. Checkpoint publication does not accept that unfinished runtime scope. Compatibility1.8 defines exact positioned/vector/seek families, checked borrowed vector sums and signed positions. Pread/Pwrite preserve the shared cursor; Pwrite ignores APPEND. One gathered prefix preserves native append atomicity. Fresh END/DATA/HOLE size comes from the same live admitted candidate and original provider object, including write-only descriptions, without new read authority or path reopening. Streams/channels retain nonblocking behavior and reject positioning. Access checks precede empty I/O. Disjoint candidate-write version two replaces the superseded API and carries an explicit full-width end limit. Ext/RAM choose EOF, clip the prefix and write in one exclusive turn. Signed boundary writes report EFBIG before effects; boundary reads distinguish EOVERFLOW before EOF from actual EOF. Positive result correlation checks the limit, while zero progress preserves content, timestamps and the shared cursor. Native callers retain their own full-width limits. Canonical correlated BUSY/RETRY without progress preserves the original fd for a later new call. Malformed/lost/uncertain results retain cleanup-only custody; refused completion never replays an effect. This fixes [VFS transient admission](https://git.erikinkinen.fi/erix/vfsd/issues/14), [Posixd transient admission](https://git.erikinkinen.fi/erix/posixd/issues/22) and [signed offset maxima](https://git.erikinkinen.fi/erix/posixd/issues/23). The reports use the bug template and remain source-derived, without executed reproduction claims. Thirty-seven new unit controls are authored and unrun: seven compatibility codec, five IPC codec, two ext, two RAM, two FAT/exFAT, five VFS and fourteen Posixd file/stream/channel controls. The native realm workload covers positioned cursor preservation, append independence, gathered/scattered bytes, shared seeks, fresh EOF after an independent writer and sparse growth. Original native authority and exit/deadline gates are preserved. Current phase progress is 17.04% weighted and 5.61% whole-item acceptance: 22/460 parents and 442/902 sub-items. Actual signal delivery and blocking waits remain unfinished; transport failure or caller disappearance never fabricates EINTR. Both full EriX guest-build generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed. Repair within [complete positioned/vectored I/O](https://git.erikinkinen.fi/erix/posixd/issues/21). Replace the candidate-write wire family with a disjoint version carrying an explicit full-width end limit, enforced atomically with EOF selection inside the provider. Retire the superseded API and update every producer/consumer together. Preserve native callers' ability to select their own representable maximum. Track overall work in [Integration](https://git.erikinkinen.fi/erix/integration/issues/65).
erikinkinen 2026-09-30 09:18:32 +02:00
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:06 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/posixd#23
No description provided.