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

Manually merged
github merged 1 commit from gh-pr/127/head into gh-pr/127/base 2026-11-26 04:11:31 +00:00
Owner

@⁠gbuyssens on GitHub · 2026-11-23 13:40 UTC · original
gbuyssens:pr/eh-pe-cpu-check → main · +182 −41 · 3 files · 1 commits · merged 2026-11-23 14:13 UTC

…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.
**@⁠gbuyssens** on GitHub · 2026-11-23 13:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/127) `gbuyssens:pr/eh-pe-cpu-check` → `main` · +182 −41 · 3 files · 1 commits · merged 2026-11-23 14:13 UTC …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.
- 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:11:29 +00:00
github manually merged commit 1a51a821bb into gh-pr/127/base 2026-11-26 04:11:31 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 14:14 UTC · original

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!

**@⁠ivall** on GitHub · 2026-11-23 14:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/127#issuecomment-7103688632) 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!
This discussion has been locked. Commenting is limited to contributors.
No description provided.