Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

python3kgae
Copy link
Contributor

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

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
Copy link
Contributor

@tex3d tex3d left a 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.

include/dxc/DxilContainer/DxilPipelineStateValidation.h Outdated Show resolved Hide resolved
Copy link
Contributor

@tex3d tex3d left a 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.
Copy link
Contributor

github-actions bot commented Sep 19, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

docs/ReleaseNotes.md Outdated Show resolved Hide resolved
Copy link
Contributor

@tex3d tex3d left a 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.

Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Allow string table in the PSV0 part to have a different order than DXC during validation
2 participants