[BUG] exFAT directory growth leaves new entries beyond the recorded length #9

Closed
opened 2026-10-01 01:07:20 +02:00 by erikinkinen · 0 comments
Owner

Summary

Creating or renaming an entry into a full non-root exFAT directory can extend its
allocation without updating its stored stream length. The resulting entry can be
outside the range used by subsequent lookup and directory enumeration.

Reproduction

Source-derived reproduction, not an executed VM or unit-test result:

  1. Mount a writable exFAT volume containing a directory with one 512-byte cluster.
  2. Create five short-named children, each using a three-entry file set.
  3. Create a sixth short-named child, requiring the entry set to cross the cluster boundary.
  4. Look up the sixth child, enumerate the directory and remount the original medium.

The same boundary can be reached by rename. Contiguous directories additionally
encounter an unconditional refusal instead of conversion to a FAT chain.
Reproduction frequency and clean-image runtime behavior have not been measured.

Expected and actual behavior

Expected: allocation, initialized length, data length and allocation flags are
published together through the retained original directory entry. Existing held
directory and child descriptions observe the new geometry. Selected original
metadata commits or rolls back with the filesystem mutation.

Source finding: free-slot allocation appends directory clusters, but its caller
retains only DirNode, without the original owner entry needed to publish the
length. Writes do not check that length; reads do. No executed error/output is
claimed.

Environment and identity

  • Component: Fatd e402563f7f1f33adf7a976ee7214cb440f7a563c.
  • Integration graph: 433f0f5479e325438ad6a668dfdea054f9366406.
  • Configuration: writable exFAT; both imported and explicitly selected original metadata are relevant.
  • Image digest, VM/hardware, firmware and toolchain: not applicable to this source finding; no image was executed.
  • Route: existing private filesystem provider with an explicitly mounted device and retained parent custody.
  • Last known working revision: unknown.

Evidence and prior checks

The affected baseline is directory allocation and entry I/O.
Source review traces the mismatch between free-slot growth and counted directory
reads. Regression controls are being authored for creation, rename, contiguous
conversion, held aliases, zero-length directories, rollback and remount.
Test/build execution and CI observation are waived by the maintainer for now.

Tracking

Complete original metadata and status/directory source acceptance — 1 October 2026

Source acceptance covers explicit format admission/recovery, persistent original identities and full metadata, shared ordinary/acquired observations, fresh permissions, atomic filesystem/catalog updates, alias and cleanup lifetime, compatibility stat families and shared seekable directory descriptions. Imported unavailable facts remain explicit refusals.

Runtime and independent fixture producers emit the mandatory stream allocation flag, which admission and image verification require.

This checkpoint authors 14 Rust and four Python controls plus two selected exFAT VM scenarios; two existing FAT scenarios now also require six-child directory growth, post-growth observations and complete cleanup.

Both complete EriX guest generations and external Rust/LLVM guest rebuilding remain required and unperformed.

Related records and contracts
Repository Links
docs PR 4
fatd issue 10, issue 9, exfat-directory-mutation.md, original-catalog.md
integration PR 12
posixd issue 25, PR 5
rootd PR 2
## Summary Creating or renaming an entry into a full non-root exFAT directory can extend its allocation without updating its stored stream length. The resulting entry can be outside the range used by subsequent lookup and directory enumeration. ## Reproduction Source-derived reproduction, not an executed VM or unit-test result: 1. Mount a writable exFAT volume containing a directory with one 512-byte cluster. 2. Create five short-named children, each using a three-entry file set. 3. Create a sixth short-named child, requiring the entry set to cross the cluster boundary. 4. Look up the sixth child, enumerate the directory and remount the original medium. The same boundary can be reached by rename. Contiguous directories additionally encounter an unconditional refusal instead of conversion to a FAT chain. Reproduction frequency and clean-image runtime behavior have not been measured. ## Expected and actual behavior Expected: allocation, initialized length, data length and allocation flags are published together through the retained original directory entry. Existing held directory and child descriptions observe the new geometry. Selected original metadata commits or rolls back with the filesystem mutation. Source finding: free-slot allocation appends directory clusters, but its caller retains only `DirNode`, without the original owner entry needed to publish the length. Writes do not check that length; reads do. No executed error/output is claimed. ## Environment and identity - Component: Fatd `e402563f7f1f33adf7a976ee7214cb440f7a563c`. - Integration graph: `433f0f5479e325438ad6a668dfdea054f9366406`. - Configuration: writable exFAT; both imported and explicitly selected original metadata are relevant. - Image digest, VM/hardware, firmware and toolchain: not applicable to this source finding; no image was executed. - Route: existing private filesystem provider with an explicitly mounted device and retained parent custody. - Last known working revision: unknown. ## Evidence and prior checks The affected baseline is [directory allocation and entry I/O](https://git.erikinkinen.fi/erix/fatd/src/commit/e402563f7f1f33adf7a976ee7214cb440f7a563c/src/exfat.rs). Source review traces the mismatch between free-slot growth and counted directory reads. Regression controls are being authored for creation, rename, contiguous conversion, held aliases, zero-length directories, rollback and remount. Test/build execution and CI observation are waived by the maintainer for now. ## Tracking - [Original FAT-family metadata](https://git.erikinkinen.fi/erix/fatd/issues/8) - [Fatd implementation review](https://git.erikinkinen.fi/erix/fatd/pulls/3) - [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65) - [x] Retain the original parent entry and publish directory geometry with allocation. - [x] Refresh held parent/child geometry and preserve selected-catalog rollback. - [x] Author independent positive, malformed-input and rollback controls; update contracts and publish coherent revisions. ### Complete original metadata and status/directory source acceptance — 1 October 2026 Source acceptance covers explicit format admission/recovery, persistent original identities and full metadata, shared ordinary/acquired observations, fresh permissions, atomic filesystem/catalog updates, alias and cleanup lifetime, compatibility stat families and shared seekable directory descriptions. Imported unavailable facts remain explicit refusals. Runtime and independent fixture producers emit the mandatory stream allocation flag, which admission and image verification require. This checkpoint authors 14 Rust and four Python controls plus two selected exFAT VM scenarios; two existing FAT scenarios now also require six-child directory growth, post-growth observations and complete cleanup. Both complete EriX guest generations and external Rust/LLVM guest rebuilding remain required and unperformed. <details> <summary>Related records and contracts</summary> | Repository | Links | | --- | --- | | docs | [PR 4](https://git.erikinkinen.fi/erix/docs/pulls/4) | | fatd | [issue 10](https://git.erikinkinen.fi/erix/fatd/issues/10), [issue 9](https://git.erikinkinen.fi/erix/fatd/issues/9), [exfat-directory-mutation.md](https://git.erikinkinen.fi/erix/fatd/src/branch/feature/posix-compat/docs/exfat-directory-mutation.md), [original-catalog.md](https://git.erikinkinen.fi/erix/fatd/src/branch/feature/posix-compat/docs/original-catalog.md) | | integration | [PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12) | | posixd | [issue 25](https://git.erikinkinen.fi/erix/posixd/issues/25), [PR 5](https://git.erikinkinen.fi/erix/posixd/pulls/5) | | rootd | [PR 2](https://git.erikinkinen.fi/erix/rootd/pulls/2) | </details>
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:00 +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#9
No description provided.