Skip to content

[upstream #1134] PE loader: reject unreadable export forwarders - #28

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1134
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1134

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

I reject an unreadable PE export forwarder instead of treating its RVA as an ordinary export address. Previously, a missing string terminator caused the forwarder data's address to enter the owned export tables.

What is in it

  • pe.rs: propagate a failed forwarder-string read as None, with a contract comment.
  • Synthetic regression covering valid and unterminated forwarders in both file and mapped layouts, including named and ordinal OwnedExports lookups.

Tested

I ran debug tests on Windows 11 Pro ARM64 10.0.26100.1742 in UTM (4 GiB RAM, virtual virt-10.0 CPU, Red Hat VirtIO GPU DOD), using Rust 1.100.0 x86_64-pc-windows-msvc and Visual Studio 2022 Build Tools. The guest used main 47efa2ecea0a12934719ae69b81930cf02a4b1c3 plus the source changes committed as aeb5ca72aa4b6f7fc4ecaad2c8225c1dff59e6e7.

cargo test --locked -p xcl --lib pe::tests::unterminated_forwarders_are_not_export_addresses -- --exact:

  • Before the fix: 0 passed, 1 failed, 0 ignored, 719 filtered out; the unterminated forwarder returned Some(Rva(4156)) instead of None.
  • After the fix: 1 passed, 0 failed, 0 ignored, 719 filtered out; no SKIPPED output.

Not tested

I have not run the full workspace suite, native x64 Windows hardware, D3D12 GPU execution or a real game title. This verifies PE parsing and owned export lookup, not loading a malformed DLL into a game process.

Regression run

Not run. This remains a draft pending the required real-title xcl-smoke blocks from main and this PR's clean head, using the same title and duration.

AI use

I used omp (openai-codex/gpt-6-astra) to investigate, implement the fix and regression, run the Windows test, and prepare this PR.


Mirror of xcl-dev#1134 (auto-synced, do not edit).

An export RVA inside the export directory denotes a forwarder string.
When that string could not be read, export_target passed None to the
ordinary-RVA fallback and exposed the string's address as an export.

Return None instead. A synthetic regression checks terminated and
unterminated forwarders in file and mapped layouts, including both named
and ordinal OwnedExports lookups.

Windows 11 ARM64 VM, x64 MSVC rustc 1.100.0: the new regression failed
before the fix (Some(Rva(4156)) instead of None), then passed: 1 passed,
0 failed, 0 ignored, 719 filtered out. Full GPU suite, native x64 hardware
and real-title smoke runs remain outstanding.

Assisted-by: omp (openai-codex/gpt-6-astra)
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#1134 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/1134 branch November 25, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants