-
Notifications
You must be signed in to change notification settings - Fork 0
Security review of deepcopy out support #1
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ming-Wei Shih <mishih@microsoft.com>
| pargs_out->n[_i_1].array_of_int = NULL; | ||
| if (_rhs[_i_1].array_of_int) | ||
| { | ||
| int* _l_1_array_of_int = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Own comment: use local variable to prevent the host from manipulating the memory used by the memcpy below. Note that the oe_host_malloc ensures that the return buffer resides on the host.
| _rhs[_i_1].array_of_int, | ||
| ((size_t)4 * sizeof(int))); | ||
| } | ||
| CountStruct* _l_1_array_of_struct = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
| _l_1_array_of_struct[_i_2].ptr = NULL; | ||
| if (_rhs[_i_1].array_of_struct[_i_2].ptr) | ||
| { | ||
| uint64_t* _l_2_ptr = (uint64_t*)oe_host_malloc( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
| { | ||
| int* _l_1_array_of_int = | ||
| (int*)oe_host_malloc(((size_t)4 * sizeof(int))); | ||
| pargs_out->n[_i_1].array_of_int = _l_1_array_of_int; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pargs_out->n[_i_1].array_of_int is under control by the host, but we won't use it directly other than this assignment.
Signed-off-by: Ming-Wei Shih mishih@microsoft.com