Skip to content

Update fatfs r016#2004

Open
benma wants to merge 3 commits into
BitBoxSwiss:masterfrom
benma:update-fatfs-r016
Open

Update fatfs r016#2004
benma wants to merge 3 commits into
BitBoxSwiss:masterfrom
benma:update-fatfs-r016

Conversation

@benma

@benma benma commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

I manually tested listing, reading, writing.

benma added 3 commits July 7, 2026 08:28
Update the vendored FatFs copy from R0.14b to R0.16 plus upstream
patch 1.

- Base archive: https://elm-chan.org/fsw/ff/arc/ff16.zip
- https://elm-chan.org/fsw/ff/patch/ff16p1.diff

Keep the existing BitBox configuration choices for LFN, tiny mode, mkfs support,
code page 850, fixed timestamps, and disabled exFAT, labels, and LBA64.
Reject mounted FAT volumes whose FAT area extends past the computed data area.
This catches crafted FAT32 BPB values where the FatFs mount calculation can wrap
`BPB_FATSz32 * NumFATs` and place the data area inside attacker-controlled FAT
sectors.

Addresses CVE-2026-6682 at the BitBox SD integration boundary without changing
vendored FatFs code.
Reject files larger than SD_MAX_FILE_SIZE before the erase path overwrites them.
The read path already enforced this limit; applying it to erase prevents a
malformed FAT directory entry from causing an excessive overwrite loop.

This mitigates the BitBox impact of CVE-2026-6682 in the stale-backup cleanup
path without changing vendored FatFs code.
@benma benma force-pushed the update-fatfs-r016 branch from c8c11fb to 2453f52 Compare July 7, 2026 06:29
@benma benma requested review from NickeZ and cedwies and removed request for NickeZ July 7, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant