v1.0.0-rc.1

key sources (keydb/online/mapfile), overflow-safe LBA
This commit is contained in:
Matthew Jackson
2026-06-21 21:06:07 -07:00
parent a4e8fbe06c
commit 3957ac70c1
4 changed files with 287 additions and 10 deletions
+8 -1
View File
@@ -125,7 +125,14 @@ pub fn read_sample_units(
break;
}
let units_this = CHUNK_UNITS.min(total_units - unit);
let lba = ext.start_lba + unit * UNIT_SECTORS;
// Saturate: start_lba comes from attacker-controlled UDF/MPLS
// extents; a malformed extent near u32::MAX would otherwise panic
// (debug) or wrap to a wrong LBA (release). Matches the hardened
// pattern in mux/disc.rs and verify.rs; an over-capacity LBA then
// fails cleanly via the read_sectors().is_err() break below.
let lba = ext
.start_lba
.saturating_add(unit.saturating_mul(UNIT_SECTORS));
let count = (units_this * UNIT_SECTORS) as u16;
let mut buf = vec![0u8; count as usize * 2048];
// `false` = no recovery retries; the reader is the raw drive/file