Skip to content
  • Ondrej Kozina's avatar
    Avoid needlessly large allocations in LUKS2 validation code. · 46ee71ed
    Ondrej Kozina authored and Milan Broz's avatar Milan Broz committed
    In case LUKS2 backup segment creates gap in between last regular
    segment and backup segment report invalid metadata imediately. We stop
    on first error so there's no need to allocate large memory on heap
    (we may ran with mlock(MCL_FUTURE) set).
    
    Example:
    - total segments count is 3
    - regular segments have keys "0" and "1"
    - first backup segment has key "42"
    46ee71ed