[BUG] Exclude final-sector padding from FAT fixed-root directories #5

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

Summary

The FAT12/FAT16 fixed-root scanner treats final-sector padding as directory slots. A declared root-entry count that does not fill its last sector can therefore expose a phantom filename from bytes outside the logical directory. This is a source-derived correctness finding; no runtime reproduction has been executed.

Reproduction

Use a fixed-root geometry with 17 declared 32-byte entries and 512-byte sectors, hence two root sectors. Mark the 17 logical entries deleted and place a syntactically valid short entry named GHOST.TXT in physical slot 17 (the first padding slot). At the revision below, scan_records iterates both complete sectors and scan_sector_records visits every 32-byte chunk. The extra entry is eligible for lookup or enumeration despite lying outside the declared directory. The added independent fixture authors this exact geometry; it is unrun under the current testing waiver.

Expected and actual behavior

Expected: scan only the declared 17 entries; final-sector padding never supplies a name. A continuation at slot 17 is EOF. Actual source behavior: sector-rounded scanning can return the padding entry. The shared scanner must cap the final slice using the declared entry count, for both legacy operations and native position-based observation.

Environment and identity

  • Component/revision: Fatd 148e8d86, original scanner.
  • Integration source graph: 5a697043.
  • Image/profile/digest: none executed; this finding comes from source inspection.
  • Hardware/VM/architecture/toolchain: no runtime invocation involved.
  • Input/session route: original private FAT provider media and existing held directory authority; no new grant or route.
  • Last known working revision: unknown.

Evidence and prior checks

The media geometry rounds root entries to sectors, while the original scanner passes each complete sector to the entry parser. The source repair bounds only the final logical slice and preserves actual block-transfer width. A literal deleted-slot/padding fixture is authored, along with a continuation control. Tests, builds, lint checks, VM/profiler execution and CI observation remain deferred. No pass or executed reproduction is claimed.

Tracking

Resolved in fatd a5481166 within the coherent signed directory 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.

Related source-qualified status and directory feature, Fatd review and Phase 6 master. The source repair and coherent immutable revisions are signed and published; testing remains waived and no executed reproduction is claimed.

## Summary The FAT12/FAT16 fixed-root scanner treats final-sector padding as directory slots. A declared root-entry count that does not fill its last sector can therefore expose a phantom filename from bytes outside the logical directory. This is a source-derived correctness finding; no runtime reproduction has been executed. ## Reproduction Use a fixed-root geometry with 17 declared 32-byte entries and 512-byte sectors, hence two root sectors. Mark the 17 logical entries deleted and place a syntactically valid short entry named GHOST.TXT in physical slot 17 (the first padding slot). At the revision below, scan_records iterates both complete sectors and scan_sector_records visits every 32-byte chunk. The extra entry is eligible for lookup or enumeration despite lying outside the declared directory. The added independent fixture authors this exact geometry; it is unrun under the current testing waiver. ## Expected and actual behavior Expected: scan only the declared 17 entries; final-sector padding never supplies a name. A continuation at slot 17 is EOF. Actual source behavior: sector-rounded scanning can return the padding entry. The shared scanner must cap the final slice using the declared entry count, for both legacy operations and native position-based observation. ## Environment and identity - Component/revision: [Fatd `148e8d86`](https://git.erikinkinen.fi/erix/fatd/commit/148e8d86189701b603e7d65f470cea8cfee50e8d), [original scanner](https://git.erikinkinen.fi/erix/fatd/src/commit/148e8d86189701b603e7d65f470cea8cfee50e8d/src/dir.rs). - Integration source graph: [5a697043](https://git.erikinkinen.fi/erix/integration/commit/5a69704355681d35f1a3ec505a6ad736ba4b60b1). - Image/profile/digest: none executed; this finding comes from source inspection. - Hardware/VM/architecture/toolchain: no runtime invocation involved. - Input/session route: original private FAT provider media and existing held directory authority; no new grant or route. - Last known working revision: unknown. ## Evidence and prior checks The media geometry rounds root entries to sectors, while the original scanner passes each complete sector to the entry parser. The source repair bounds only the final logical slice and preserves actual block-transfer width. A literal deleted-slot/padding fixture is authored, along with a continuation control. Tests, builds, lint checks, VM/profiler execution and CI observation remain deferred. No pass or executed reproduction is claimed. ## Tracking Resolved in [fatd `a5481166`](https://git.erikinkinen.fi/erix/fatd/commit/a548116665dcd8f9d19730904a75a0d3d7620b52) within the coherent signed directory 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. Related [source-qualified status and directory feature](https://git.erikinkinen.fi/erix/posixd/issues/25), [Fatd review](https://git.erikinkinen.fi/erix/fatd/pulls/3) and [Phase 6 master](https://git.erikinkinen.fi/erix/integration/issues/65). The source repair and coherent immutable revisions are signed and published; testing remains waived and no executed reproduction is claimed.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:33:59 +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/fatd#5
No description provided.