-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Validator] Check size of PSV. #6924
base: main
Are you sure you want to change the base?
Conversation
Check size of PSV part matches the PSVVersion. Updated DxilPipelineStateValidation::ReadOrWrite to read based on initInfo.PSVVersion. And return fail when size mismatch in RWMode::Read. Fixes microsoft#6817
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not block loading of newer PSV versions. Need to do this only in the validator code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the comments, we should be checking the string and index tables more thoroughly:
- check that string table is well formed - size is aligned, buffer ends with
\0
- check that accesses to string table entries are in-bounds, before using the value.
- check that accesses to index table entries are in-bounds, and that the (index+1)+size is within dword size of index table, before using the index array.
Then use PSVInitInfo to calculate correct size of PSV.
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly, I think we need to do away with the extra size check based on module facts, since it would only hit this, after other checks passed, when it would be better to report a more specific mismatch later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Check size of PSV part matches the PSVVersion.
Updated DxilPipelineStateValidation::ReadOrWrite to read based on initInfo.PSVVersion.
And return fail when size mismatch in RWMode::Read.
Fixes #6817