[BUG] Valid exFAT cluster sizes are rejected #18

Open
opened 2026-10-18 15:22:16 +02:00 by erikinkinen · 2 comments
Owner

Summary

Fatd rejects valid exFAT clusters larger than 128 sectors. For example, a volume with 512-byte sectors and 128 KiB clusters cannot mount, although the format allows clusters through 32 MiB.

Reproduction

Mount a consistent exFAT volume with BytesPerSectorShift = 9 and SectorsPerClusterShift = 8. These fields describe 256 sectors per cluster. The existing parser returns INVALID_ARGUMENT before mount admission.

The independent sparse-media controls reproduce the same refusal without allocating a volume-sized buffer. Against the original parser, five controls fail and two pass; Cargo exits 101. The first output and exit status are retained.

Expected and actual behavior

Accept format-defined cluster sizes when the original FAT, heap, metadata and device bounds pass. The parser instead imposes a 128-sector maximum and stores the sector count in u8.

The allocator's zeroing counter also uses u8. Supporting larger clusters requires traversing the complete allocation, including sector indexes above 255, while retaining sector-sized scratch storage and the existing write ceiling.

Environment and identity

  • Fatd: 3a4b046c750363aa1d57feea2d6e43f9ffba8cea.
  • Coordinated Integration catalog: 305803617d2b23995e314abfafce797e81e19036.
  • x86-64 host controls and EriX native builds; Rust 1.97.1.
  • Original block and mount capabilities; no added endpoint, device or write grant.
  • No guest reproduction or last working revision has been established for this range.

Evidence and prior checks

The exFAT specification, section 3.1.15 defines the cluster maximum from the sector width, with a 32 MiB ceiling. The repair keeps the format's cluster-count maximum and the existing device checks.

All eleven local checks pass on the repair, including 331 units in each feature selection, strict host/native Clippy, private-item Rustdoc and native runtime/release builds. No warning diagnostics were emitted. Seven new controls cover every permitted shift, full clearing, transfers across sector 255, malformed geometry and read-only refusal.

Tracking

  • Admit format-defined cluster sizes within the original device and volume bounds.
  • Clear the complete allocation without cluster-sized scratch storage.
  • Preserve malformed-input, format-maximum and write-ceiling refusals.
  • Exercise mount, allocation and cross-sector transfers on independent sparse media.
  • Run the large-cluster guest case on the coordinated source graph.

Implementation: PR #3. Phase scope: Integration #65.

## Summary Fatd rejects valid exFAT clusters larger than 128 sectors. For example, a volume with 512-byte sectors and 128 KiB clusters cannot mount, although the format allows clusters through 32 MiB. ## Reproduction Mount a consistent exFAT volume with `BytesPerSectorShift = 9` and `SectorsPerClusterShift = 8`. These fields describe 256 sectors per cluster. The existing parser returns `INVALID_ARGUMENT` before mount admission. The independent sparse-media controls reproduce the same refusal without allocating a volume-sized buffer. Against the original parser, five controls fail and two pass; Cargo exits 101. The first output and exit status are retained. ## Expected and actual behavior Accept format-defined cluster sizes when the original FAT, heap, metadata and device bounds pass. The parser instead imposes a 128-sector maximum and stores the sector count in `u8`. The allocator's zeroing counter also uses `u8`. Supporting larger clusters requires traversing the complete allocation, including sector indexes above 255, while retaining sector-sized scratch storage and the existing write ceiling. ## Environment and identity - Fatd: `3a4b046c750363aa1d57feea2d6e43f9ffba8cea`. - Coordinated Integration catalog: `305803617d2b23995e314abfafce797e81e19036`. - x86-64 host controls and EriX native builds; Rust 1.97.1. - Original block and mount capabilities; no added endpoint, device or write grant. - No guest reproduction or last working revision has been established for this range. ## Evidence and prior checks [The exFAT specification, section 3.1.15](https://learn.microsoft.com/en-us/windows/win32/fileio/exfat-specification#3115-sectorsperclustershift-field) defines the cluster maximum from the sector width, with a 32 MiB ceiling. The repair keeps the format's cluster-count maximum and the existing device checks. All eleven local checks pass on the repair, including 331 units in each feature selection, strict host/native Clippy, private-item Rustdoc and native runtime/release builds. No warning diagnostics were emitted. Seven new controls cover every permitted shift, full clearing, transfers across sector 255, malformed geometry and read-only refusal. ## Tracking - [x] Admit format-defined cluster sizes within the original device and volume bounds. - [x] Clear the complete allocation without cluster-sized scratch storage. - [x] Preserve malformed-input, format-maximum and write-ceiling refusals. - [x] Exercise mount, allocation and cross-sector transfers on independent sparse media. - [ ] Run the large-cluster guest case on the coordinated source graph. Implementation: [PR #3](https://git.erikinkinen.fi/erix/fatd/pulls/3). Phase scope: [Integration #65](https://git.erikinkinen.fi/erix/integration/issues/65).
Author
Owner

Published 4cf3847a. The parser admits the format-defined cluster range, and allocation clearing traverses every sector through the existing block capability. The original five failing controls are retained; all 331 units and the host/native checks pass on the repair. Integration 0b58a24f selects it in both catalogs. The dedicated guest case is being completed; guest acceptance remains open.

Published [4cf3847a](https://git.erikinkinen.fi/erix/fatd/commit/4cf3847a24709428391472cbbf3e83560f2b02ac). The parser admits the format-defined cluster range, and allocation clearing traverses every sector through the existing block capability. The original five failing controls are retained; all 331 units and the host/native checks pass on the repair. [Integration 0b58a24f](https://git.erikinkinen.fi/erix/integration/commit/0b58a24fb3e7ed37c000103717cd69d8ae5c8cca) selects it in both catalogs. The dedicated guest case is being completed; guest acceptance remains open.
Author
Owner

Integration 7d3e7b3f adds a separate 128 KiB cluster case, including a poisoned allocation tail checked through sector 255. It preserves the existing guest cases, authority inventory, markers and deadlines. Execution of the new guest case remains open.

Integration [7d3e7b3f](https://git.erikinkinen.fi/erix/integration/commit/7d3e7b3f845d1fea372a4f682126ccb3c3b9496b) adds a separate 128 KiB cluster case, including a poisoned allocation tail checked through sector 255. It preserves the existing guest cases, authority inventory, markers and deadlines. Execution of the new guest case remains open.
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#18
No description provided.