PE loader: refuse IAT and TLS-index writes inside the headers (#836) #848

Merged
Longno242 merged 1 commit from upstream-pr/854 into main 2026-12-02 13:20:40 +00:00
Longno242 commented 2026-11-24 06:51:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-24T06:51:47Z.


Fixes #836.

A crafted PE whose import address table, delay-load HMODULE slot, or TLS AddressOfIndex lands below SizeOfHeaders would let the manual mapper overwrite its own headers before later steps re-read them. Reject those directory-derived write targets once in pe.rs (PeError::HeaderWriteTarget). Targets must lie in [size_of_headers, size_of_image).

What is in it

  • crates/xcl/src/pe.rs: ensure_data_write_rva, checks in import thunks / delay-load HMODULE / TLS index parsing, and unit tests for IAT, delay-load HMODULE, and TLS index inside the headers plus the SizeOfHeaders boundary

Tested

  • Hardware/OS (full suite by @upipibi, head 6ce1240498cd787448963da24cd8f5e892feb0da as-is, base 47efa2e): NVIDIA RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after cargo build --workspace
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 736 passed, 0 failed, 41 ignored. End-to-end title tests passed.
  • SKIPPED: 2 GPU tests, both no wave64 on this card. hle::xaudio2 was skipped because those tests fail or hang on this machine on main too; this PR does not touch it.
  • @Decodere, release, head 6ce1240498cd787448963da24cd8f5e892feb0da, RTX 4060 8 GB (Ada, wave32), driver 32.0.16.2114, i5-11400F, 32 GB, Windows 11 build 26200, rustc 1.100.0, DXC 1.9.2609.5: the four header-write tests passed 3/3 (4 passed, 0 failed), and cargo test --release -p xcl --lib pe:: passed 3/3 (14 passed, 0 failed). cargo build --release -p xcl was clean.
  • Retail smoke: see Regression run (@Toons29, RX 9070)
  • Earlier on this machine: cargo test -p xcl --lib pe::tests: 14 passed (includes the delay-load HMODULE case). @DavidM1911 also ran cargo test -p xcl --lib after merging the branch with then-current main (RTX 3060 Ti): passed, with a note about intermittent #1978 under parallel scheduling.

Regression run

  • Retail scripts/smoke.ps1 from @Toons29 (RX 9070, 60 s, same title/time; blocks as printed):
xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 6ce1240498cd787448963da24cd8f5e892feb0da
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1633 (PresentX 1633)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14686 MB

Not tested

  • hle::xaudio2 on the RTX 3070 report (pre-existing on main for that machine)
  • wave64-only GPU paths
  • live title coverage of the header-write rejection itself (smoke is a regression check only)

AI use

  • @Decodere: Google Antigravity (Gemini 4 Neon) ran the release pe:: tests and drafted the report
  • @upipibi: Claude Code (Claude Opus 5.5) ran the workspace suite and wrote the test report
  • Cursor Auto (Composer): found #836 uncovered by open PRs, implemented the parse-time rejection and tests, rebased onto main, added the delay-load HMODULE coverage test, opened/updated this draft PR. Exact underlying model name not disclosed to the agent.
<!-- greyfinch-sync:ivall/xcl:issue:5467536492 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854). Originally posted by [Longno242](https://github.com/Longno242) on 2026-11-24T06:51:47Z. --- Fixes #836. A crafted PE whose import address table, delay-load HMODULE slot, or TLS `AddressOfIndex` lands below `SizeOfHeaders` would let the manual mapper overwrite its own headers before later steps re-read them. Reject those directory-derived write targets once in `pe.rs` (`PeError::HeaderWriteTarget`). Targets must lie in `[size_of_headers, size_of_image)`. **What is in it** - `crates/xcl/src/pe.rs`: `ensure_data_write_rva`, checks in import thunks / delay-load HMODULE / TLS index parsing, and unit tests for IAT, delay-load HMODULE, and TLS index inside the headers plus the `SizeOfHeaders` boundary **Tested** - Hardware/OS (full suite by @upipibi, head `6ce1240498cd787448963da24cd8f5e892feb0da` as-is, base `47efa2e`): NVIDIA RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after `cargo build --workspace` - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2`: **736 passed, 0 failed, 41 ignored**. End-to-end title tests passed. - `SKIPPED`: 2 GPU tests, both `no wave64` on this card. `hle::xaudio2` was skipped because those tests fail or hang on this machine on `main` too; this PR does not touch it. - @Decodere, release, head `6ce1240498cd787448963da24cd8f5e892feb0da`, RTX 4060 8 GB (Ada, wave32), driver 32.0.16.2114, i5-11400F, 32 GB, Windows 11 build 26200, rustc 1.100.0, DXC 1.9.2609.5: the four header-write tests passed 3/3 (`4 passed, 0 failed`), and `cargo test --release -p xcl --lib pe::` passed 3/3 (`14 passed, 0 failed`). `cargo build --release -p xcl` was clean. - Retail smoke: see **Regression run** (@Toons29, RX 9070) - Earlier on this machine: `cargo test -p xcl --lib pe::tests`: 14 passed (includes the delay-load HMODULE case). @DavidM1911 also ran `cargo test -p xcl --lib` after merging the branch with then-current `main` (RTX 3060 Ti): passed, with a note about intermittent #1978 under parallel scheduling. **Regression run** - Retail `scripts/smoke.ps1` from @Toons29 (RX 9070, 60 s, same title/time; blocks as printed): ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 6ce1240498cd787448963da24cd8f5e892feb0da gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1633 (PresentX 1633) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14686 MB ``` **Not tested** - `hle::xaudio2` on the RTX 3070 report (pre-existing on `main` for that machine) - wave64-only GPU paths - live title coverage of the header-write rejection itself (smoke is a regression check only) **AI use** - @Decodere: Google Antigravity (Gemini 4 Neon) ran the release `pe::` tests and drafted the report - @upipibi: Claude Code (Claude Opus 5.5) ran the workspace suite and wrote the test report - Cursor Auto (Composer): found #836 uncovered by open PRs, implemented the parse-time rejection and tests, rebased onto main, added the delay-load HMODULE coverage test, opened/updated this draft PR. Exact underlying model name not disclosed to the agent.
dcastell1 commented 2026-11-24 08:03:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T07:50:57Z.


Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean main@beaa245 (713 passed, 0 failed, 41 ignored on this box):

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
716 passed; 0 failed; 41 ignored   (exit 0)

Three more passing tests than main, so the PE-loader refusals for IAT and TLS-index writes inside the headers are exercised here; nothing else changes verdict.

Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

<!-- greyfinch-sync:ivall/xcl:comment:7125438914 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/854#issuecomment-7125438914). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T07:50:57Z. --- Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean `main@beaa245` (713 passed, 0 failed, 41 ignored on this box): ``` patch -p1 < this PR # clean, no fuzz cargo test --workspace -- --test-threads=4 716 passed; 0 failed; 41 ignored (exit 0) ``` Three more passing tests than main, so the PE-loader refusals for IAT and TLS-index writes inside the headers are exercised here; nothing else changes verdict. Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
SlopTart commented 2026-11-24 09:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T08:09:30Z.


Linux / AMD RDNA3 datapoint.

Merged state: head 46376c5 onto main 1ec4c98, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 707 passed, 11 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit of gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes (new flake, see #718 addendum). PE-header write-rejection tests green - closes the #836 hardening on this rig.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7125793967 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/854#issuecomment-7125793967). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T08:09:30Z. --- Linux / AMD RDNA3 datapoint. **Merged state:** head `46376c5` onto main `1ec4c98`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **707 passed, 11 failed, 41 ignored**. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit of `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` (new flake, see #718 addendum). PE-header write-rejection tests green - closes the #836 hardening on this rig. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Longno242 commented 2026-11-24 13:03:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-24T12:51:24Z.


Thanks for the independent verification runs (@dcastell1, @SlopTart).

This PR still needs the two retail xcl-smoke blocks under Regression run (main + this head, same title/time) before the description check can pass. I do not have an Xbox Series X|S package here — only a PC Xbox Minecraft Launcher install, which is not a Scarlett title.

If someone with a Series title can run:

# on main, then on this PR head (clean tree, no uncommitted changes)
cargo build --release -p xcl
.\scripts\smoke.ps1 -Game '<Series title folder>' -Seconds 60

and paste both xcl-smoke v1 blocks (or drop them here so I can add them to the description), that would unblock merge review. Happy to update the PR body and mark ready once those are in.

No game data needed in the comment — only the smoke block text.

<!-- greyfinch-sync:ivall/xcl:comment:7132012085 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/854#issuecomment-7132012085). Originally posted by [Longno242](https://github.com/Longno242) on 2026-11-24T12:51:24Z. --- Thanks for the independent verification runs (@dcastell1, @SlopTart). This PR still needs the two retail `xcl-smoke` blocks under **Regression run** (main + this head, same title/time) before the description check can pass. I do not have an Xbox Series X|S package here — only a PC Xbox Minecraft Launcher install, which is not a Scarlett title. If someone with a Series title can run: ```powershell # on main, then on this PR head (clean tree, no uncommitted changes) cargo build --release -p xcl .\scripts\smoke.ps1 -Game '<Series title folder>' -Seconds 60 ``` and paste both `xcl-smoke v1` blocks (or drop them here so I can add them to the description), that would unblock merge review. Happy to update the PR body and mark ready once those are in. No game data needed in the comment — only the smoke block text.
Toons29 commented 2026-11-25 03:06:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:03:58Z.


Regression run of 6ce12404 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 6ce1240498cd787448963da24cd8f5e892feb0da
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1633 (PresentX 1633)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14686 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 99 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7151555283 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7151555283). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:03:58Z. --- Regression run of `6ce12404` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 6ce1240498cd787448963da24cd8f5e892feb0da gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1633 (PresentX 1633) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14686 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 99 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
DavidM1911 commented 2026-11-25 11:08:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:15:43Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7159452783 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7159452783). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:15:43Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Longno242 commented 2026-11-25 13:05:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-25T12:36:29Z.


Thanks @Toons29 — pasted both of your xcl-smoke v1 blocks under Regression run so the description check can see them.

<!-- greyfinch-sync:ivall/xcl:comment:7162607568 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7162607568). Originally posted by [Longno242](https://github.com/Longno242) on 2026-11-25T12:36:29Z. --- Thanks @Toons29 — pasted both of your `xcl-smoke v1` blocks under **Regression run** so the description check can see them.
Longno242 commented 2026-11-25 13:05:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-25T12:43:39Z.


CI is stuck on action_required (first-time contributor workflow approval). Smoke + PR description are green; please approve the pending CI workflow when you get a chance.

<!-- greyfinch-sync:ivall/xcl:comment:7162771486 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7162771486). Originally posted by [Longno242](https://github.com/Longno242) on 2026-11-25T12:43:39Z. --- CI is stuck on `action_required` (first-time contributor workflow approval). Smoke + **PR description** are green; please approve the pending **CI** workflow when you get a chance.
upipibi commented 2026-11-25 20:08:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T19:51:09Z.


NVIDIA test report for 6ce1240 (head as is, base 47efa2e), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after cargo build --workspace:

  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 736 passed, 0 failed, 41 ignored. The end-to-end title tests pass.
  • Skipped hle::xaudio2, because its tests fail or hang on this machine on main too. The PR doesn't touch it.
  • SKIPPED lines: 2, both no wave64 on this card.

AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.

<!-- greyfinch-sync:ivall/xcl:comment:7172849832 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7172849832). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T19:51:09Z. --- NVIDIA test report for `6ce1240` (head as is, base `47efa2e`), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after `cargo build --workspace`: - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2`: **736 passed, 0 failed, 41 ignored**. The end-to-end title tests pass. - Skipped `hle::xaudio2`, because its tests fail or hang on this machine on `main` too. The PR doesn't touch it. - SKIPPED lines: 2, both `no wave64` on this card. AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
Longno242 commented 2026-11-26 13:05:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-26T12:33:28Z.


Thanks @upipibi — copied the workspace counts for 6ce1240 into Tested (736 passed, 0 failed, 41 ignored, hle::xaudio2 skipped).

<!-- greyfinch-sync:ivall/xcl:comment:7192156383 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7192156383). Originally posted by [Longno242](https://github.com/Longno242) on 2026-11-26T12:33:28Z. --- Thanks @upipibi — copied the workspace counts for `6ce1240` into **Tested** (736 passed, 0 failed, 41 ignored, `hle::xaudio2` skipped).
gut0to commented 2026-11-26 16:33:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T16:33:53Z.

Review: COMMENTED


AI-assisted review: I inspected the diff and the loader write sites; I did not run tests.

<!-- greyfinch-sync:ivall/xcl:review:6077622138 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#pullrequestreview-6077622138). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-26T16:33:53Z. **Review:** COMMENTED --- AI-assisted review: I inspected the diff and the loader write sites; I did not run tests.
gut0to commented 2026-11-26 16:33:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T16:33:54Z.

Code review location: crates/xcl/src/pe.rs; line 416

@@ -405,6 +410,19 @@ impl<'a> Pe<'a> {
         u32::try_from(r).ok()
     }
 
+    /// Refuse an RVA the loader would write into when it still needs the headers intact
+    /// (IAT thunks, delay-load module handles, TLS `AddressOfIndex`). Targets must lie in
+    /// `[size_of_headers, size_of_image)`.
+    fn ensure_data_write_rva(&self, rva: u32) -> Result<(), PeError> {

Could this validate the full write width, not only the starting RVA? thunks accepts an IAT slot at SizeOfImage - 4 because that start is in range, but the loader writes an entire u64 there (loader.rs IAT and delay-load module-handle writes); similarly, the TLS index write is a u32. A malformed image can therefore pass this new guard and make the loader write past the mapped image. Please use a checked [rva, rva + width) range check for each target and add upper-bound cases where the slot starts inside the image but ends beyond SizeOfImage. AI-assisted review: I inspected the diff and the loader write sites; I did not run tests.

<!-- greyfinch-sync:ivall/xcl:review-comment:4711169295 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#discussion_r4711169295). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-26T16:33:54Z. **Code review location:** `crates/xcl/src/pe.rs`; line 416 ~~~~diff @@ -405,6 +410,19 @@ impl<'a> Pe<'a> { u32::try_from(r).ok() } + /// Refuse an RVA the loader would write into when it still needs the headers intact + /// (IAT thunks, delay-load module handles, TLS `AddressOfIndex`). Targets must lie in + /// `[size_of_headers, size_of_image)`. + fn ensure_data_write_rva(&self, rva: u32) -> Result<(), PeError> { ~~~~ --- Could this validate the full write width, not only the starting RVA? `thunks` accepts an IAT slot at `SizeOfImage - 4` because that start is in range, but the loader writes an entire `u64` there (`loader.rs` IAT and delay-load module-handle writes); similarly, the TLS index write is a `u32`. A malformed image can therefore pass this new guard and make the loader write past the mapped image. Please use a checked `[rva, rva + width)` range check for each target and add upper-bound cases where the slot starts inside the image but ends beyond `SizeOfImage`. AI-assisted review: I inspected the diff and the loader write sites; I did not run tests.
Longno242 commented 2026-11-27 09:34:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-27T09:34:34Z.

Code review location: crates/xcl/src/pe.rs; line 416

@@ -405,6 +410,19 @@ impl<'a> Pe<'a> {
         u32::try_from(r).ok()
     }
 
+    /// Refuse an RVA the loader would write into when it still needs the headers intact
+    /// (IAT thunks, delay-load module handles, TLS `AddressOfIndex`). Targets must lie in
+    /// `[size_of_headers, size_of_image)`.
+    fn ensure_data_write_rva(&self, rva: u32) -> Result<(), PeError> {

The start-only check on this PR is the header case (#836). The full write is checked in #1203, which is the next commit on this branch.

ensure_data_write_rva(rva, width) requires [rva, rva + width) to sit in [SizeOfHeaders, SizeOfImage), with checked_add so the end cannot wrap. Call sites pass the width the loader actually stores: 8 for an IAT slot and a delay-load HMODULE, 4 for the TLS AddressOfIndex.

Upper-bound tests on that PR:

  • import_address_table_straddling_image_end_is_error — IAT at SizeOfImage - 4, rejected as BadRva
  • tls_index_straddling_image_end_is_error — TLS index at SizeOfImage - 2, rejected as BadRva

There is no separate delay-load HMODULE straddle test; that slot uses the same width-8 check as the IAT.

<!-- greyfinch-sync:ivall/xcl:review-comment:4717732715 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#discussion_r4717732715). Originally posted by [Longno242](https://github.com/Longno242) on 2026-11-27T09:34:34Z. **Code review location:** `crates/xcl/src/pe.rs`; line 416 ~~~~diff @@ -405,6 +410,19 @@ impl<'a> Pe<'a> { u32::try_from(r).ok() } + /// Refuse an RVA the loader would write into when it still needs the headers intact + /// (IAT thunks, delay-load module handles, TLS `AddressOfIndex`). Targets must lie in + /// `[size_of_headers, size_of_image)`. + fn ensure_data_write_rva(&self, rva: u32) -> Result<(), PeError> { ~~~~ --- The start-only check on this PR is the header case (#836). The full write is checked in #1203, which is the next commit on this branch. `ensure_data_write_rva(rva, width)` requires `[rva, rva + width)` to sit in `[SizeOfHeaders, SizeOfImage)`, with `checked_add` so the end cannot wrap. Call sites pass the width the loader actually stores: 8 for an IAT slot and a delay-load HMODULE, 4 for the TLS `AddressOfIndex`. Upper-bound tests on that PR: - `import_address_table_straddling_image_end_is_error` — IAT at `SizeOfImage - 4`, rejected as `BadRva` - `tls_index_straddling_image_end_is_error` — TLS index at `SizeOfImage - 2`, rejected as `BadRva` There is no separate delay-load HMODULE straddle test; that slot uses the same width-8 check as the IAT.
Decodere commented 2026-11-27 10:45:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T10:45:38Z.


Independent desktop NVIDIA verification of PR #854 at head 6ce1240498cd787448963da24cd8f5e892feb0da (1 commit; exact parent & merge-base: 47efa2ecea0a12934719ae69b81930cf02a4b1c3, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (6ce12404)

Command Result
cargo test --release -p xcl --lib -- --nocapture import_address_table_in_headers_is_error tls_index_in_headers_is_error delay_import_module_handle_in_headers_is_error write_targets_at_size_of_headers_are_accepted (3 consecutive runs) 4 passed; 0 failed; 0 ignored; 719 filtered out × 3 (0.00s, 0.00s, 0.00s, 0 skipped)
cargo test --release -p xcl --lib pe:: -- --nocapture (3 consecutive runs) 14 passed; 0 failed; 0 ignored; 709 filtered out × 3 (0.00s, 0.00s, 0.01s, 0 skipped)
cargo build --release -p xcl Clean build (55.45s, exit 0, 0 new warnings in pe.rs)

Paired quiet 60 s retail smoke (title: 29640639)

(Note: scripts/smoke.ps1 at 47efa2ec predates 9683e7a6 and printed the local folder basename on title:; replaced below with the standard 9683e7a6 title hash 29640639, with all measured fields verbatim.)

Exact parent & merge-base (47efa2ecea0a12934719ae69b81930cf02a4b1c3):

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1527 (PresentX 1527)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14723 MB

PR #854 (6ce1240498cd787448963da24cd8f5e892feb0da):

xcl-smoke v1
commit: 6ce1240498cd787448963da24cd8f5e892feb0da
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1586 (PresentX 1587)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14712 MB

Limits of coverage

  • All 4 new #836 header-write rejection / boundary tests (import_address_table_in_headers_is_error, tls_index_in_headers_is_error, delay_import_module_handle_in_headers_is_error, write_targets_at_size_of_headers_are_accepted) plus the full pe:: suite (14/14, 0 skipped) passed 3/3.
  • The 60 s retail smoke confirms real retail PE loading and runtime execution remain completely unaffected (0 device removals, 0 crashes, steady 60 Hz); single-run frame/commit delta vs. parent reflects normal startup variance.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7216271783 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7216271783). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T10:45:38Z. --- Independent desktop NVIDIA verification of **PR #854** at head `6ce1240498cd787448963da24cd8f5e892feb0da` (`1` commit; exact parent & merge-base: `47efa2ecea0a12934719ae69b81930cf02a4b1c3`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`6ce12404`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- --nocapture import_address_table_in_headers_is_error tls_index_in_headers_is_error delay_import_module_handle_in_headers_is_error write_targets_at_size_of_headers_are_accepted` (3 consecutive runs) | `4 passed; 0 failed; 0 ignored; 719 filtered out` × 3 (`0.00s`, `0.00s`, `0.00s`, `0` skipped) | | `cargo test --release -p xcl --lib pe:: -- --nocapture` (3 consecutive runs) | `14 passed; 0 failed; 0 ignored; 709 filtered out` × 3 (`0.00s`, `0.00s`, `0.01s`, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`55.45s`, exit `0`, `0` new warnings in `pe.rs`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) *(Note: `scripts/smoke.ps1` at `47efa2ec` predates `9683e7a6` and printed the local folder basename on `title:`; replaced below with the standard `9683e7a6` title hash `29640639`, with all measured fields verbatim.)* Exact parent & merge-base (`47efa2ecea0a12934719ae69b81930cf02a4b1c3`): ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1527 (PresentX 1527) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14723 MB ``` PR #854 (`6ce1240498cd787448963da24cd8f5e892feb0da`): ``` xcl-smoke v1 commit: 6ce1240498cd787448963da24cd8f5e892feb0da gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1586 (PresentX 1587) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14712 MB ``` ### Limits of coverage - All 4 new `#836` header-write rejection / boundary tests (`import_address_table_in_headers_is_error`, `tls_index_in_headers_is_error`, `delay_import_module_handle_in_headers_is_error`, `write_targets_at_size_of_headers_are_accepted`) plus the full `pe::` suite (`14/14`, `0` skipped) passed `3/3`. - The 60 s retail smoke confirms real retail PE loading and runtime execution remain completely unaffected (`0` device removals, `0` crashes, steady 60 Hz); single-run frame/commit delta vs. parent reflects normal startup variance. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
Longno242 commented 2026-11-27 14:15:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Longno242 on 2026-11-27T14:15:28Z.


Thanks @Decodere. The release pe:: results for 6ce12404 are in Tested (four header-write tests 3/3, full pe:: 14/14 3/3).

The smoke blocks stay in this comment. scripts/smoke.ps1 printed a folder name on title:, and that line was replaced with 29640639 before posting. Regression run keeps the unedited pair from @Toons29 for this same head.

<!-- greyfinch-sync:ivall/xcl:comment:7220551372 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7220551372). Originally posted by [Longno242](https://github.com/Longno242) on 2026-11-27T14:15:28Z. --- Thanks @Decodere. The release `pe::` results for `6ce12404` are in **Tested** (four header-write tests 3/3, full `pe::` 14/14 3/3). The smoke blocks stay in this comment. `scripts/smoke.ps1` printed a folder name on `title:`, and that line was replaced with `29640639` before posting. **Regression run** keeps the unedited pair from @Toons29 for this same head.
relativespace2K commented 2026-11-30 03:24:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T03:24:25Z.


merge-check
base: 53e85fb1
head: 6ce1240498
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2792 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in --test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its four new tests passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.
review: no blocking finding; one file, every hunk read. One predicate, rva >= SizeOfHeaders && rva < SizeOfImage, now guards the three places the loader writes into a mapped image: each IAT slot as the thunks are walked, the delay-load HMODULE slot, and the TLS AddressOfIndex (with RVA 0 still meaning "no index"). Refusing the header range is right because those writes would land on the DOS/NT headers that the loader itself has already read and that a later step still needs; the upper bound reuses the existing BadRva, so nothing that was previously accepted beyond SizeOfImage changes. The tests build real little PE images for the three refusals and one acceptance at exactly SizeOfHeaders, which is the boundary that decides whether a legitimate image is turned away. Notes, not blocking: the TLS branch reports BadRva(0) rather than the address it refused (cosmetic in the message only), and a title whose IAT really does live in the headers would now fail to load instead of corrupting itself, which is the intent of #836 but is the one behaviour change to keep in mind. No duplicate: #854 is the only one touching this; #291 and #1217 are other loader fixes.
performance: one comparison per IAT slot and per delay-load entry, at load time.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7267864864 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7267864864). Originally posted by [relativespace2K](https://github.com/relativespace2K) on 2026-11-30T03:24:25Z. --- merge-check base: 53e85fb1 head: 6ce1240498cd787448963da24cd8f5e892feb0da merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2792 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in `--test gpu_two_pass_cache_e2e`, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its four new tests passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused. review: no blocking finding; one file, every hunk read. One predicate, `rva >= SizeOfHeaders && rva < SizeOfImage`, now guards the three places the loader writes into a mapped image: each IAT slot as the thunks are walked, the delay-load HMODULE slot, and the TLS `AddressOfIndex` (with RVA 0 still meaning "no index"). Refusing the header range is right because those writes would land on the DOS/NT headers that the loader itself has already read and that a later step still needs; the upper bound reuses the existing `BadRva`, so nothing that was previously accepted beyond `SizeOfImage` changes. The tests build real little PE images for the three refusals and one acceptance at exactly `SizeOfHeaders`, which is the boundary that decides whether a legitimate image is turned away. Notes, not blocking: the TLS branch reports `BadRva(0)` rather than the address it refused (cosmetic in the message only), and a title whose IAT really does live in the headers would now fail to load instead of corrupting itself, which is the intent of #836 but is the one behaviour change to keep in mind. No duplicate: #854 is the only one touching this; #291 and #1217 are other loader fixes. performance: one comparison per IAT slot and per delay-load entry, at load time. verdict: safe to merge hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
brainhay5 commented 2026-11-30 03:25:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T03:25:58Z.


merge-check claim
head: 6ce1240498

<!-- greyfinch-sync:ivall/xcl:comment:7267887236 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7267887236). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T03:25:58Z. --- merge-check claim head: 6ce1240498cd787448963da24cd8f5e892feb0da
brainhay5 commented 2026-11-30 03:31:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T03:31:56Z.


merge-check
base: cfb9753a8c
head: 6ce1240498
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2837 passed, 1 failed, 51 ignored; 29 SKIPPED lines
failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check: diff read for safety (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

<!-- greyfinch-sync:ivall/xcl:comment:7267973089 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7267973089). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T03:31:56Z. --- merge-check base: cfb9753a8cbf5517ee36914b7041cb62b4a97582 head: 6ce1240498cd787448963da24cd8f5e892feb0da merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2837 passed, 1 failed, 51 ignored; 29 SKIPPED lines failing: test_title_runs_and_game_folder_is_untouched review: automated overnight check: diff read for safety (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed. performance: not assessed beyond the suite. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
Elytes commented 2026-11-30 10:21:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Elytes on 2026-11-30T10:21:47Z.


merge-check
base: 9dfbe3ea66
head: 6ce1240498
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2889 passed, 1 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer, 1 driver cache needs Developer Mode); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, also failing on the base alone (base lib 2737 passed / 1 failed, merge 2741 / 1; the +4 are this PR's tests, passing).
review: no blocking finding after reading the whole diff and the comments. Real PEs: xcl inspect --json on 18 PE files of a retail title (its exe, 16 DLLs and one .bin; 1,924 IAT slots, 4 with TLS, no delay imports) gives byte-identical output on base and merge, so no legitimate import or TLS index is refused there. The delay-load HMODULE check is covered by its unit test only. Note, not blocking: loader.rs fails the load on an imports() error, but only warns on a delay_imports() error (the module then loads with no delay imports) and skips TLS silently on a tls() error, so a crafted delay-load HMODULE or TLS index in the headers now gives a module loaded without them rather than a refused load. That is how those paths already treat BadRva.
performance: one bounds check per IAT slot and per delay-load / TLS directory at load time (reasoned).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.1742, wave32), Intel Core i9-14900KS, 192 GB, Windows 11 build 26300.10075, rustc 1.100.1, debug / Claude Code (Claude Opus 5.5) ran the merge, build, suite and the inspect comparison on base and merge, and reviewed the diff, loader.rs and the comments.

<!-- greyfinch-sync:ivall/xcl:comment:7275486602 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7275486602). Originally posted by [Elytes](https://github.com/Elytes) on 2026-11-30T10:21:47Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 6ce1240498cd787448963da24cd8f5e892feb0da merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2889 passed, 1 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer, 1 driver cache needs Developer Mode); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, also failing on the base alone (base lib 2737 passed / 1 failed, merge 2741 / 1; the +4 are this PR's tests, passing). review: no blocking finding after reading the whole diff and the comments. Real PEs: `xcl inspect --json` on 18 PE files of a retail title (its exe, 16 DLLs and one .bin; 1,924 IAT slots, 4 with TLS, no delay imports) gives byte-identical output on base and merge, so no legitimate import or TLS index is refused there. The delay-load HMODULE check is covered by its unit test only. Note, not blocking: loader.rs fails the load on an imports() error, but only warns on a delay_imports() error (the module then loads with no delay imports) and skips TLS silently on a tls() error, so a crafted delay-load HMODULE or TLS index in the headers now gives a module loaded without them rather than a refused load. That is how those paths already treat BadRva. performance: one bounds check per IAT slot and per delay-load / TLS directory at load time (reasoned). verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.1742, wave32), Intel Core i9-14900KS, 192 GB, Windows 11 build 26300.10075, rustc 1.100.1, debug / Claude Code (Claude Opus 5.5) ran the merge, build, suite and the inspect comparison on base and merge, and reviewed the diff, loader.rs and the comments.
Foniass commented 2026-12-01 04:19:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:19:23Z.


Triage (#1607) – head 6ce1240

#1203 (same author) is stacked on this PR: it contains this commit and adds a width check on top, so it is not a duplicate and this PR should land first. #1367 bounds IAT/HMODULE/relocation writes against SizeOfImage in loader.rs and pe.rs but does not refuse targets inside the headers, so it does not cover #836.
Minor: pe.rs tls() reports a TLS AddressOfIndex that va_to_rva cannot map as BadRva(0) rather than the VA.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300614821 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/854#issuecomment-7300614821). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:19:23Z. --- **Triage (#1607)** – head 6ce1240 #1203 (same author) is stacked on this PR: it contains this commit and adds a width check on top, so it is not a duplicate and this PR should land first. #1367 bounds IAT/HMODULE/relocation writes against SizeOfImage in loader.rs and pe.rs but does not refuse targets inside the headers, so it does not cover #836. Minor: pe.rs tls() reports a TLS AddressOfIndex that va_to_rva cannot map as BadRva(0) rather than the VA. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!848
No description provided.