[BUG] Valid exFAT cluster sizes are rejected #18
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/fatd#18
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 = 9andSectorsPerClusterShift = 8. These fields describe 256 sectors per cluster. The existing parser returnsINVALID_ARGUMENTbefore 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
3a4b046c750363aa1d57feea2d6e43f9ffba8cea.305803617d2b23995e314abfafce797e81e19036.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
Implementation: PR #3. Phase scope: Integration #65.
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.
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.