Skip to content

Commit c650b8d

Browse files
jforissierjenswi-linaro
authored andcommitted
tee: optee: do not check memref size on return from Secure World
When Secure World returns, it may have changed the size attribute of the memory references passed as [in/out] parameters. The GlobalPlatform TEE Internal Core API specification does not restrict the values that this size can take. In particular, Secure World may increase the value to be larger than the size of the input buffer to indicate that it needs more. Therefore, the size check in optee_from_msg_param() is incorrect and needs to be removed. This fixes a number of failed test cases in the GlobalPlatform TEE Initial Configuratiom Test Suite v2_0_0_0-2017_06_09 when OP-TEE is compiled without dynamic shared memory support (CFG_CORE_DYN_SHM=n). Reviewed-by: Sumit Garg <[email protected]> Suggested-by: Jens Wiklander <[email protected]> Signed-off-by: Jerome Forissier <[email protected]> Signed-off-by: Jens Wiklander <[email protected]>
1 parent a38fd87 commit c650b8d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

drivers/tee/optee/core.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,6 @@ int optee_from_msg_param(struct tee_param *params, size_t num_params,
7979
return rc;
8080
p->u.memref.shm_offs = mp->u.tmem.buf_ptr - pa;
8181
p->u.memref.shm = shm;
82-
83-
/* Check that the memref is covered by the shm object */
84-
if (p->u.memref.size) {
85-
size_t o = p->u.memref.shm_offs +
86-
p->u.memref.size - 1;
87-
88-
rc = tee_shm_get_pa(shm, o, NULL);
89-
if (rc)
90-
return rc;
91-
}
9282
break;
9383
case OPTEE_MSG_ATTR_TYPE_RMEM_INPUT:
9484
case OPTEE_MSG_ATTR_TYPE_RMEM_OUTPUT:

0 commit comments

Comments
 (0)