Runtime: CPU check at start, bounded reads in the exception logger, t… #126

Merged
gbuyssens merged 1 commit from upstream-pr/127 into main 2026-11-23 14:13:38 +00:00
gbuyssens commented 2026-11-23 13:40:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gbuyssens on 2026-11-23T13:40:07Z.


…hread dump and probes guarded, PE directory bounds (#106)

  • The launcher refuses to start on a CPU without the console Zen 2's extensions (AVX2, FMA, F16C, BMI1 / BMI2, LZCNT, POPCNT, MOVBE, SSE4.2) with a message naming them instead of the title's illegal-instruction crash; XCL_SKIP_CPU_CHECK=1 runs anyway.
  • cpp_exception_logger: null checks on the exception pointers, strings read only as far as the memory is readable (a fault in the vectored handler would have made the exception fatal).
  • dump_threads takes only the context while a thread is suspended; the unwinding, module lookup and formatting (loader and heap locks the thread may hold) run after ResumeThread.
  • watch_writes / start_probes: an invalid snapshot and a failed SuspendThread are checked.
  • PE: offsets into the import / delay-import / relocation directories are checked (a table at the top of the address space overflowed u32: a panic in debug builds), and a relocation block claiming more than the directory holds is an error instead of a walk over up to 2^31 entries. Test on kernel32 with the block size and the import directory corrupted.
<!-- greyfinch-sync:ivall/xcl:issue:6560604032 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/127). Originally posted by [gbuyssens](https://github.com/gbuyssens) on 2026-11-23T13:40:07Z. --- …hread dump and probes guarded, PE directory bounds (#106) - The launcher refuses to start on a CPU without the console Zen 2's extensions (AVX2, FMA, F16C, BMI1 / BMI2, LZCNT, POPCNT, MOVBE, SSE4.2) with a message naming them instead of the title's illegal-instruction crash; XCL_SKIP_CPU_CHECK=1 runs anyway. - cpp_exception_logger: null checks on the exception pointers, strings read only as far as the memory is readable (a fault in the vectored handler would have made the exception fatal). - dump_threads takes only the context while a thread is suspended; the unwinding, module lookup and formatting (loader and heap locks the thread may hold) run after ResumeThread. - watch_writes / start_probes: an invalid snapshot and a failed SuspendThread are checked. - PE: offsets into the import / delay-import / relocation directories are checked (a table at the top of the address space overflowed u32: a panic in debug builds), and a relocation block claiming more than the directory holds is an error instead of a walk over up to 2^31 entries. Test on kernel32 with the block size and the import directory corrupted.
upstream-sync closed this pull request 2026-11-24 06:57:16 +00:00
ivall commented 2026-11-24 07:00:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T14:14:12Z.


Merged. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129: cargo test --workspace green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with XCL_SPLIT_WAVE64=1; the retail pack still translates 26 698 / 26 698; the FSR4 GPU probe passes; Unicorn Overlord and XDefiant run. Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7103688632 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/127#issuecomment-7103688632). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T14:14:12Z. --- Merged. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129: `cargo test --workspace` green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with `XCL_SPLIT_WAVE64=1`; the retail pack still translates 26 698 / 26 698; the FSR4 GPU probe passes; Unicorn Overlord and XDefiant run. Thanks!
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!126
No description provided.