HomeFreeBSD

msdosfs: sanity check sector count from BPB

Description

msdosfs: sanity check sector count from BPB

We use sector count to size the FAT inuse bitset. If sector count is
corrupted, kernel might be tricked into doing unbound allocation.
Ensure that the sector count does not exceed the actual volume size.

In collaboration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

Details

Provenance
kibAuthored on Dec 30 2021, 7:45 PM
Reviewer
markj
Differential Revision
D33721: Improve msdosfs robustness
Parents
rG65990b68a2cd: msdosfs: clusterfree() is used only in error handling cases
Branches
Unknown
Tags
Unknown