HomeFreeBSD

Ensure that cluster allocations never allocate clusters outside the

Description

Ensure that cluster allocations never allocate clusters outside the
volume limits. In particular:

  • Assert that usemap_alloc() and usemap_free() cluster number argument is valid.
  • In chainlength(), return 0 if cluster start is after the max cluster.
  • In chainlength(), cut the calculated cluster chain length at the max cluster.
  • For true paranoia, after the pm_inusemap is calculated in fillinusemap(), reset all bits in the array for clusters after the max cluster, as in-use.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Details

Provenance
kibAuthored on
Parents
rS308023: If the fatchain() call in chainalloc() returned an error, revert
Branches
Unknown
Tags
Unknown