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

further clarify a clCreateBuffer with SVM pointer error condition #1189

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

karolherbst
Copy link
Contributor

It should also be invalid to use SVM host_ptr smaller than size in the CL_MEM_COPY_HOST_PTR case

It should also be invalid to use SVM host_ptr smaller than `size` in the CL_MEM_COPY_HOST_PTR case
@karolherbst
Copy link
Contributor Author

Not sure if this has been specifically discussed in the OpenCL WG, but it feels like an oversight as this is almost guaranteed to cause segmentation faults if not caught.

@karolherbst
Copy link
Contributor Author

Though I think if runtimes are supposed to check those pointers here, they might as well check if the access is generally out of bounds, e.g. using an SVM allocation + 0x100 of size 0x1000 and then using 0x1000 as the size to clCreateBuffer, which will cause undefined behavior if not checked by the runtime.

(But so does passing random host ptrs with invalid sizes where runtimes can't bound check)

Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

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

Linking with #875, which I believe prompted the current text.

This seems reasonable to me, though if we merge these changes we really ought to have a negative CTS test to check for the new error behavior..

@bashbaug bashbaug added the needs-cts-coverage The CTS needs to be extended label Jul 16, 2024
@bashbaug
Copy link
Contributor

Merging as discussed in the August 13th teleconference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cts-coverage The CTS needs to be extended
Development

Successfully merging this pull request may close these issues.

3 participants