{
int idx;
struct tee_context *ctx;
+ TEEC_Operation op;
BUG_ON(!cmd_io);
BUG_ON(!cmd_io->op);
TEEC_NONE, TEEC_NONE, TEEC_NONE))
return;
+ if (tee_context_copy_from_client(ctx, &op, cmd_io->op, sizeof(op)))
+ return;
+
for (idx = 0; idx < TEEC_CONFIG_PAYLOAD_REF_COUNT; ++idx) {
int type = TEEC_PARAM_TYPE_GET(cmd->param.type_original, idx);
int offset = 0;
/* Returned updated size */
size_new = cmd->param.params[idx].shm->size_req;
if (size_new !=
- cmd_io->op->params[idx].tmpref.size) {
+ op.params[idx].tmpref.size) {
dev_dbg(_DEV_TEE,
"Size has been updated by the TA %zd != %zd\n",
size_new,
- cmd_io->op->params[idx].tmpref.size);
+ op.params[idx].tmpref.size);
tee_put_user(ctx, size_new,
&cmd_io->op->params[idx].tmpref.size);
}
cmd->param.params[idx].shm->kaddr);
/* ensure we do not exceed the shared buffer length */
- if (size_new > cmd_io->op->params[idx].tmpref.size)
+ if (size_new > op.params[idx].tmpref.size)
dev_err(_DEV_TEE,
" *** Wrong returned size from %d:%zd > %zd\n",
idx, size_new,
- cmd_io->op->params[idx].tmpref.size);
+ op.params[idx].tmpref.size);
else if (tee_copy_to_user
(ctx,
- cmd_io->op->params[idx].tmpref.buffer,
+ op.params[idx].tmpref.buffer,
cmd->param.params[idx].shm->kaddr,
size_new))
dev_err(_DEV_TEE,
offset = 0;
size = parent->size;
} else {
- offset = cmd_io->op->params[idx].memref.offset;
- size = cmd_io->op->params[idx].memref.size;
+ offset = op.params[idx].memref.offset;
+ size = op.params[idx].memref.size;
}
/* Returned updated size */