Skip to content

fix for buffer length check (rdma osc w/ odd datatypes) #3577

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
May 26, 2017

Conversation

markalle
Copy link
Contributor

The osc_rdma_get_remote_segment() has the 3rd and 4th args as

  • target_disp
  • length
    which it uses to determine if the rdma falls within the bounds of
    the window or not (actually it only checks the upper bound, but I'm
    okay with that).

Anyway the caller previously was passing in the length argument as
target_datatype->super.size * target_count
which which doesn't really represent the number of bytes after target_disp
for which data exists. In particular I could create a datatype as
{ disp -4, len 4 } and use target_disp 4
and that would be bytes 0-3 of the window where the original code
would think it was bytes 4-7 and could abort at the range check.

Ive changed it to use the opal_datatype_span() function.

Fixes 3576

Signed-off-by: Mark Allen [email protected]

The osc_rdma_get_remote_segment() has the 3rd and 4th args as
* target_disp
* length
which it uses to determine if the rdma falls within the bounds of
the window or not (actually it only checks the upper bound, but I'm
okay with that).

Anyway the caller previously was passing in the length argument as
    target_datatype->super.size * target_count
which which doesn't really represent the number of bytes after target_disp
for which data exists. In particular I could create a datatype as
    { disp -4, len 4 } and use target_disp 4
and that would be bytes 0-3 of the window where the original code
would think it was bytes 4-7 and could abort at the range check.

Ive changed it to use the opal_datatype_span() function.

Signed-off-by: Mark Allen <[email protected]>
@hjelmn
Copy link
Member

hjelmn commented May 25, 2017

Does the same thing apply to get and accumulate? It might be worth reworking the code for osc_rdma_get_remote_segment() to handle this case.

@jjhursey jjhursey requested a review from bosilca May 26, 2017 14:06
@jjhursey jjhursey added the bug label May 26, 2017
@jjhursey jjhursey merged commit 4bfb0fc into open-mpi:master May 26, 2017
@jjhursey
Copy link
Member

@markalle This needs to go to the release branches, right?

@markalle
Copy link
Contributor Author

Since only weird tests will hit this I'm okay with it merely eventually making its way into the various OMPI releases from master if everybody else is.

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

Successfully merging this pull request may close these issues.

4 participants