startup: a view description at a readable page boundary loses the shim's view checks under the Agility headers #3538
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#3538
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@KelboLive on GitHub · 2026-11-30 02:26 UTC · original
startup: a view description at a readable page boundary loses the shim's view checks under the Agility headers
Summary
Two view-description reads in
view_slot()take their length from the desktop struct'ssizeofinsteadof from the guest record. The Agility SDK 1.620.2 header makes
D3D12_UNORDERED_ACCESS_VIEW_DESC48 byteswhere the record the title supplies is 40, so when a description ends exactly at a readable page boundary
the 48-byte read fails
readable()and the surrounding check is skipped rather than failing.This is the third instance of the same assumption. #3512 (compute output tokens) and #3525 (pixel UAV views)
were the other two and are merged.
Sites
src/startup_stubs/d3d12_xs_device.cpp:The record width is already in the tree as
ViewRecord::uav_desc_bytesandViewRecord::srv_desc_bytes(both 40,
d3d12_capture.inl:55-56) and is whatnote_view()uses when it writes the record(
d3d12_xs_device.cpp:5586-5587), so the two sets of numbers disagree under the Agility header.Consequence
readable()test fails and neither branchruns. The
volume_uav_range_error()/ 1D mip check is then skipped, so an out-of-range mip isaccepted instead of refused. This is a missed validation, not a crash.
desc_copyblock, so console-format mapping and thepacked-target detection do not run for that view and it is created with the title's raw format.
There is also a plain over-read:
memcpy(desc_copy, args[desc_index], 48)copies 8 bytes beyond a 40-byteguest record into a local buffer.
desc_copyis currently uninitialised(
alignas(D3D12_SHADER_RESOURCE_VIEW_DESC) unsigned char desc_copy[64];, line 5648), so those 8 bytes areboth read past the guest object and left indeterminate.
Why it has not been fixed yet
No test or run has produced this failure, because it needs a description placed at a page boundary. Under
the in-box headers
sizeofis already 40, so bothmainCI jobs are also blind to it. Fixing it without arepro would be a change with no failing case behind it, which this project asks contributors not to submit.
Suggested reproduction
VirtualAlloctwo pages and commit only the first.page_end - 40, so bytes 40..47 are in the uncommitted page, withTexture3D.MipSlicepast the resource's mip count.an output 3D texture mip is outside the resource). Today the branch isskipped and the view is created.
The same shape covers 5650 by checking that a console format in the description is still mapped when the
description sits at the boundary.
Suggested fix
Use the record widths, as #3512 and #3525 do:
ViewRecord::uav_desc_bytes/srv_desc_bytes, plus the20-byte and 16-byte widths
note_view()already uses for slots 20 and 21, withdesc_copyzero-initialisedand the copy limited to the record width. A shared helper holding the width, the copy and the
static_assertwould be the right shape, since this is the third site.