Repository navigation
Conversation
|
Review: correct and well-scoped — |
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…ut::File Two bounds/overflow bugs in pe.rs: - TlsDir::total_len added `template_len() + size_of_zero_fill as u64` without saturating, panicking in debug or wrapping in release when `end_raw - start_raw` is near u64::MAX. - Pe::rva_to_offset in Layout::File returned `Some(rva)` (for headers) or `Some(raw_ptr + delta)` (for sections) without checking that the offset lies within `self.data.len()`, unlike Layout::Mapped. Use saturating_add in TlsDir::total_len and validate `off < self.data.len()` (with checked addition) in Layout::File, with unit tests for both. Assisted-by: OpenCode (Gemini 4 Neon)
6cb357b to
1e920a0
Compare
|
Thanks @pickles976 — pinned the exact boundary in \1e920a0\ ( |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
xcl-dev#1397) Port live head 1e920a0 (still OPEN, merge-base exit 1). WHOLE fix in shared pe.rs: saturating_add in total_len; off < data.len() with checked addition on both File-layout rva_to_offset branches. Tests: tls_dir_total_len unit as-is; kernel32 truncation test as-is behind cfg(windows) (needs kernel32.dll) + synthetic pe_with_headers twin covering the same two boundaries plus the header branch on Linux. Failing-first: overflow panic at :145 + Some(0x410)==len pre-fix. Gates: both checks 0 errors, lib 745/0/1 (+2), pe:: 23/23, title e2e fresh-root 12 unique FAILs all D3D12.X 0 non-GPU, retail fresh-root HOLDS (+0x2237320, stubs 20, xgr 3 apis, unmapped []). Lock audit 0.
|
merge-check claim |
|
merge-check |
|
No open or merged PR makes the same change; main's AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Fixes two bounds/overflow bugs in
crates/xcl/src/pe.rs:TlsDir::total_lenaddedself.template_len() + self.size_of_zero_fill as u64without saturating, panicking in debug or wrapping in release whenend_raw - start_rawis nearu64::MAX.Pe::rva_to_offsetinLayout::FilereturnedSome(rva as usize)(for headers) orSome(s.raw_ptr as usize + delta as usize)(for sections) without checking that the offset lies withinself.data.len(), unlikeLayout::Mapped.This uses
saturating_addinTlsDir::total_lenand checksoff < self.data.len()(with checked addition) inLayout::File.What is in it
crates/xcl/src/pe.rs: saturateTlsDir::total_len; bounds-checkLayout::Fileoffsets inPe::rva_to_offset; add unit teststls_dir_total_len_saturates_instead_of_overflowingandrva_to_offset_in_file_layout_rejects_offsets_past_eof(including exactraw_ptr + delta == data.len()boundary check; both verified failing before the fix).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 753 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib pe::tests: 12 passed, 0 failed (both new tests failed before the fix)Regression run
main:
PR:
Not tested
AI use
pe.rs, wrote the fixes and unit tests, added the exactraw_ptr + delta == data.len()boundary assertion per review feedback, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.