[BUG] Preserve pre-Epoch inode timestamps instead of returning zero #14

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

Summary

E2fsd silently maps valid pre-Epoch inode timestamps to zero. A file dated before 1970 therefore appears to have an Epoch/unknown time instead of its actual signed timestamp. This blocks truthful POSIX status semantics and can change build-tool ordering decisions.

Reproduction

Source-derived minimal input, not an executed reproduction: in media/inode_time.rs, decode_inode_time(0xffffffff, 0) sign-extends the low seconds word to -1, then its seconds < 0 branch returns Ok(0). A legacy inode with atime/mtime/ctime word0xffffffff at offsets8/16/12 reaches this path. The extra word zero contributes no epoch extension and no nanoseconds. Inspect the function at the exact revision below; no test, image, CI or runtime command was run under the current execution waiver.

Expected and actual behavior

Expected: preserve the represented time -1 second with a zero nanosecond fraction in a signed source-qualified observation. A legacy unsigned interface that cannot represent it must return an explicit error, not another successful timestamp. Actual source behavior: Ok(0), indistinguishable from Epoch/unknown metadata. Valid negative dates must remain distinct from missing creation-time extensions and malformed fractions.

Environment and identity

  • Component/revision: E2fsd 01ba4dcd, decoder source.
  • Integration source graph: c51e2f93.
  • Image profile, digest and runtime configuration: none executed; static source finding.
  • Hardware, architecture, firmware and toolchain: no runtime execution involved.
  • Input/session authority: ordinary metadata decoding from the retained original inode; no new capability or route.
  • Last known working revision: unknown.

Evidence and prior checks

The source has an explicit negative-seconds-to-zero branch. The independent ext inode format documentation defines signed base seconds plus the two extra epoch bits, including valid1901-1969 dates. No implementation code was copied. Add literal negative/boundary/fraction controls, preserve absence separately, and preflight rejected encodings before touching caller bytes. Tests remain authored-but-unrun until the user resumes execution.

Tracking

Resolved in e2fsd cb569b33 within the coherent signed metadata dependency closure. Appropriate regression controls are authored and unrun. Source repair and publication are complete; testing and CI execution remain waived, with no executed reproduction or pass claimed.

Repair within the coordinated status/directory feature and update E2fsd review and the Phase6 master. Use the bug_report template and bug/phase-6 metadata. The source repair is signed and published; deferred test execution does not block acceptance.

## Summary E2fsd silently maps valid pre-Epoch inode timestamps to zero. A file dated before 1970 therefore appears to have an Epoch/unknown time instead of its actual signed timestamp. This blocks truthful POSIX status semantics and can change build-tool ordering decisions. ## Reproduction Source-derived minimal input, not an executed reproduction: in media/inode_time.rs, decode_inode_time(0xffffffff, 0) sign-extends the low seconds word to -1, then its seconds < 0 branch returns Ok(0). A legacy inode with atime/mtime/ctime word0xffffffff at offsets8/16/12 reaches this path. The extra word zero contributes no epoch extension and no nanoseconds. Inspect the function at the exact revision below; no test, image, CI or runtime command was run under the current execution waiver. ## Expected and actual behavior Expected: preserve the represented time -1 second with a zero nanosecond fraction in a signed source-qualified observation. A legacy unsigned interface that cannot represent it must return an explicit error, not another successful timestamp. Actual source behavior: Ok(0), indistinguishable from Epoch/unknown metadata. Valid negative dates must remain distinct from missing creation-time extensions and malformed fractions. ## Environment and identity - Component/revision: [E2fsd `01ba4dcd`](https://git.erikinkinen.fi/erix/e2fsd/commit/01ba4dcd42bfac14f168e02f6fdf866f4f3c283c), [decoder source](https://git.erikinkinen.fi/erix/e2fsd/src/commit/01ba4dcd42bfac14f168e02f6fdf866f4f3c283c/src/media/inode_time.rs). - Integration source graph: [c51e2f93](https://git.erikinkinen.fi/erix/integration/commit/c51e2f93a0c63b7febbab11321d8a8d1203635b8). - Image profile, digest and runtime configuration: none executed; static source finding. - Hardware, architecture, firmware and toolchain: no runtime execution involved. - Input/session authority: ordinary metadata decoding from the retained original inode; no new capability or route. - Last known working revision: unknown. ## Evidence and prior checks The source has an explicit negative-seconds-to-zero branch. The independent [ext inode format documentation](https://www.kernel.org/doc/html/v5.18/filesystems/ext4/dynamic.html#inode-timestamps) defines signed base seconds plus the two extra epoch bits, including valid1901-1969 dates. No implementation code was copied. Add literal negative/boundary/fraction controls, preserve absence separately, and preflight rejected encodings before touching caller bytes. Tests remain authored-but-unrun until the user resumes execution. ## Tracking Resolved in [e2fsd `cb569b33`](https://git.erikinkinen.fi/erix/e2fsd/commit/cb569b336c0c9c7d854a1dc8f8aa9bf93a63e2a6) within the coherent signed metadata dependency closure. Appropriate regression controls are authored and unrun. Source repair and publication are complete; testing and CI execution remain waived, with no executed reproduction or pass claimed. Repair within the coordinated status/directory feature and update [E2fsd review](https://git.erikinkinen.fi/erix/e2fsd/pulls/3) and the [Phase6 master](https://git.erikinkinen.fi/erix/integration/issues/65). Use the bug_report template and bug/phase-6 metadata. The source repair is signed and published; deferred test execution does not block acceptance.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:33:46 +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/e2fsd#14
No description provided.