D3D12.X: retain root signature COM ownership in device_x Base descriptor (#1488) #1634
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1634
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1634"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@slopgobblercobbler on GitHub · 2026-11-24 18:26 UTC · original
slopgobblercobbler:fix/root-signature-lifetime→main· +100 −2 · 1 files · 1 commits · openSummary
Retains root signature COM pointer ownership in
device_x::Base::descincrates/xcl/src/hle/d3d12x/device_x.rsto prevent use-after-free (Issue #1488, findingXCL-BT-005):device_x::Base, added_root_sig: Option<ID3D12RootSignature>to retain strong ownership of the root signature COM object.note_base, extractedpRootSignaturepointer atROOT_SIGNATURE(offset 0) and retained viaID3D12RootSignature::from_raw_borrowed(&root_sig_ptr).cloned(), incrementing the COM reference count viaAddRef.CreateDerivedPipelineStateXandRSSetDepthBiasXcalls reuse the cachedBase::descto callCreateGraphicsPipelineState.forget_base), droppingBasedrops_root_sig, safely invoking COMRelease.root_signature_lifetime_retained_in_base_and_safely_releasedwith synthetic COM mock object: validates initial refcount increment (AddRef) uponnote_base, survival after caller releases its reference (preventing UAF), retention across derived pipelines, safe release on descriptor drop (forget_base) when refcount drops to 0, and safe handling of null root signature descriptors.Changes
crates/xcl/src/hle/d3d12x/device_x.rs:Basestruct.Tested
cargo test -p xcl -- device_x: 9 passed, 0 failed.cargo test -p xcl -- list_x: 27 passed, 0 failed.upstream/main, GPL-2.0-only compliant, zero retail game data or keys.Not Tested
AI Use
Co-Authored-By: Claude Code (Claude Opus 5.5) / Gemini Antigravity
@Anon64 on GitHub · 2026-11-24 19:33 UTC · original
Regression run for this PR: head
f4be21e, based onmain9e3831e. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
9e3831e:this PR:
No device removals or crashes; 101 % of main's frames, 100 % of its peak commit.
Peak commit on this machine is mostly the pipeline preload's DXC compiles (#1035) and varies from run to run, so it says little about this PR.
Not tested: the whole suite; whether the title reaches the changed code in these 60 s.
Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@DavidM1911 on GitHub · 2026-11-24 20:56 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
@throny on GitHub · 2026-11-24 22:59 UTC · original
Two contributors checked independently and found that this PR makes the same change as #1619 (for #1488): #1607, group D48. They suggest keeping #1619. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
github-bot referenced this pull request2026-11-26 06:18:30 +00:00
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.