forked from GPUOpen-Drivers/xgl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid unaligned memory accesses in PBC deserialization
The pipeline binary cache (PBC) data format is as follows: ``` | Public Header | Private Header (20B) | Entry (24B) | Blob (n) | Entry (24B) | ... ``` Binary cache entry headers (`Entry` above) require the alignment of 8 bytes, which is not guaranteed with this data format. Therefore we cannot use `reinterpret_cast` to read cache entry headers when reading PBC blobs. This bug was found with the undefined behavior sanitizer. Although we have not seen this being a problem in real-world applications, we would like to get this fixed so that we run the code under UBSan and find other issues in the future. Fixes: GPUOpen-Drivers#143.
- Loading branch information
Showing
4 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters