DXIL.dll crashes on intrinsics that are not defined for a known shader model #6168
Labels
bug
Bug, regression, crash
crash
DXC crashing or hitting an assert
sm6.8
Shader Model 6.8
validation
Related to validation or signing
Milestone
Description
Given DXIL that declares itself as shader model 6.7 / DXIL 1.7, but uses intrinsic functions defined by shader model 6.8, attempting to validate that DXIL module will crash with an access violation.
Steps to Reproduce
See the relevant code in
dxil::OP
:For every intrinsic function,
GetOpFunc
is called to instantiate it in the cache. InsideGetOpFunc
:Those asserts for "otherwise caller..." should be validation, because the caller clearly didn't do any validation. As a result, indexing into
m_OpCodeProps
can use an out-of-bounds index, meaning that accessingopCodeClass
could be an access violation directly, or at best could return garbage. I was seeing it return a pointer-type value, which was then used to index intom_OpCodeClassCache
, which failed catastrophically.My repro was done by accidentally inserting SampleCmpBias instructions into a SM6.7 shader in the Mesa DXIL backend. DXC will not emit such a shader, since it has validation against doing so earlier on in the compilation process.
The text was updated successfully, but these errors were encountered: