Closed mingweishih closed 3 years ago
@CodeMonkeyLeet Can you take a look? We need to retain OE_COMPUTE_ARG_SIZE
. If we use OE_ADD_ARG_SIZE
to calculate _size
(say argcount=1
, argsize=4
), OE_ADD
will apply the alignment (16
) to the result, making the _size
become 16
instead 4
. This will cause memory overwritten in memcpy
.
#define OE_READ_OUT_PARAM(argname, argcount, argsize) \
if (argname) \
{ \
size_t _size = 0; \
OE_COMPUTE_ARG_SIZE(_size, argcount, argsize); \
memcpy((void*)argname, _output_buffer + _output_buffer_offset, _size); \
OE_ADD_SIZE(_output_buffer_offset, _size); \
}
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: CodeMonkeyLeet, mingweishih
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Address comments from https://github.com/openenclave/openenclave/pull/3831
Signed-off-by: Ming-Wei Shih mishih@microsoft.com