Skip to content

[SYCL] Default-initialize UR structs used in handler_impl #14885

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

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

ianayl
Copy link
Contributor

@ianayl ianayl commented Jul 31, 2024

The C-style structs used by the handler_impl for bindless images are not initialized. Although their values get initialized later in execution, when it is decided this information is actually used, leaving these values uninitialized still leave the possibility of vulnerabilities. This PR initializes them.

I'd like to bring attention to the fact that we could also use std::optional here, although that'll increase the size used for each field here. Zero initializing these structs is also an option, although I noticed many of these structs have default values, so I default initialized instead. If std::optional or zero initializing would be a better option here, please let me know and I'll make the changes. Thanks!

@ianayl ianayl requested a review from a team as a code owner July 31, 2024 21:26
@ianayl ianayl requested a review from uditagarwal97 July 31, 2024 21:26
@ianayl ianayl temporarily deployed to WindowsCILock July 31, 2024 21:27 — with GitHub Actions Inactive
@ianayl ianayl temporarily deployed to WindowsCILock July 31, 2024 23:31 — with GitHub Actions Inactive
@ianayl
Copy link
Contributor Author

ianayl commented Aug 13, 2024

@intel/llvm-gatekeepers This should be ready for merge; The last pending CI check is for the E2E test on AWS CUDA; this test has been disabled and thus won't finish.

@sarnex sarnex merged commit eabbb15 into intel:sycl Aug 13, 2024
15 of 16 checks passed
AlexeySachkov pushed a commit to AlexeySachkov/llvm that referenced this pull request Nov 26, 2024
The C-style structs used by the `handler_impl` for bindless images are
not initialized. Although their values get initialized later in
execution, when it is decided this information is actually used, leaving
these values uninitialized still leave the possibility of
vulnerabilities. This PR initializes them.

I'd like to bring attention to the fact that we could also use
`std::optional` here, although that'll increase the size used for each
field here. Zero initializing these structs is also an option, although
I noticed many of these structs have default values, so I default
initialized instead. If `std::optional` or zero initializing would be a
better option here, please let me know and I'll make the changes.
Thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants