Repository navigation
Conversation
AddressOfCallbacks was walked with no length or SizeOfImage check, so a malformed list could read past the mapping. Cap at 256 entries and refuse slots that straddle the image end. Assisted-by: Cursor Auto (Composer) Co-authored-by: Cursor <cursoragent@cursor.com>
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Note: the full |
|
Regression run of Against the limits in CONTRIBUTING.md: 101 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
|
Thanks @Toons29 — pasted both of your |
|
CI is stuck on |
|
Full workspace run (listed under Not tested). Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head 54ae876. Result: cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED: 2 GPU tests for no wave64 (expected on this card). AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
|
Thanks @jennydeth — copied your workspace counts into Tested (742 passed, 0 failed, 41 ignored. SKIPPED: 2 GPU tests for no wave64 (expected on this card)). |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
… load (port upstream xcl-dev#1212 + xcl-dev#1208) Windows loader.rs (cfg(windows)-only, reference-only on Linux): delay_imports Err arm goes from warn-only to unregister+fail like a broken import table; TLS AddressOfCallbacks walk is capped at 256 entries and bounded to the image (va_to_rva outside-image guard + checked_add past-end guard), with unregister+fail on all three failure legs. Both upstream tests verbatim; 0 tests run on Linux. Linux loader_linux.rs twin: TLS walk already image-bounded (checked_rva + at+8>size + per-target va_to_rva, strictly stricter than the 256-entry cap) so pin test only; delay_imports warn-only mirrored to unregister+fail with twin retry test. Graft red pre-fix, green post-fix.
|
Thanks @DavidM1911 — noted the |
|
merge-check claim |
|
merge-check claim |
|
merge-check |
|
merge-check |
|
#1376 (later, conflicting) also bounds this walk in loader.rs:map_image_ex, but differently: it checks that the start pointer is in the image and stops the walk at the image end, and it also validates the TLS directory and index pointer. This PR fails the load when the array runs past SizeOfImage or has more than 256 entries. The two need to be reconciled whichever merges second. No problems found in the diff; the 256-entry cap is an arbitrary limit that is not in Windows' loader. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
AddressOfCallbacks was walked with
while *cb != 0and no SizeOfImage check, so a malformed TLS directory could read past the mapped image (or never terminate if the mapping stayed non-zero).What is in it
crates/xcl/src/loader.rs: cap the callback array at 256 entries, require each slot insideSizeOfImage, fail the load otherwise; unit test with AddressOfCallbacks atSizeOfImage - 4Tested
54ae876d011117193aaf4046a50315439df78ea5(clean tree)cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED: 2 GPU tests for no wave64 (expected on this card)SKIPPED: 2 GPU tests for no wave64 (expected on this card)cargo test -p xcl --libon RTX 3060 Ti after merging this head with currentmainlocally: all passed, 0 failed, 27 ignored. The PR head itself is unchanged.Regression run
scripts/smoke.ps1from @Toons29 (RX 9070, 60 s, same title/time; blocks as printed):Not tested
cargo test --workspaceAI use