]> git.baikalelectronics.ru Git - kernel.git/commit
tee: optee: do not check memref size on return from Secure World
authorJerome Forissier <jerome@forissier.org>
Mon, 22 Mar 2021 10:40:37 +0000 (11:40 +0100)
committerJens Wiklander <jens.wiklander@linaro.org>
Tue, 30 Mar 2021 08:44:50 +0000 (10:44 +0200)
commit263946319c27a98e32008f188a34e9e6b47644a9
tree18a62c7103b2ce9cec1e1b090f9c54bbc0de1604
parent1b8bd930b05ba1f659bccfc6ef406e93916f57ed
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 <sumit.garg@linaro.org>
Suggested-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/core.c