KEYS: trusted: tee: Refactor register SHM usage
authorSumit Garg <sumit.garg@linaro.org>
Tue, 22 Aug 2023 11:29:33 +0000 (16:59 +0530)
committerJarkko Sakkinen <jarkko@kernel.org>
Tue, 24 Oct 2023 00:06:35 +0000 (03:06 +0300)
commitc745cd1718b7825d69315fe7127e2e289e617598
tree7ca3fcb2c2559b28294f3a552b64339ed5f151b2
parent31de287345f41bbfaec36a5c8cbdba035cf76442
KEYS: trusted: tee: Refactor register SHM usage

The OP-TEE driver using the old SMC based ABI permits overlapping shared
buffers, but with the new FF-A based ABI each physical page may only
be registered once.

As the key and blob buffer are allocated adjancently, there is no need
for redundant register shared memory invocation. Also, it is incompatibile
with FF-A based ABI limitation. So refactor register shared memory
implementation to use only single invocation to register both key and blob
buffers.

[jarkko: Added cc to stable.]
Cc: stable@vger.kernel.org # v5.16+
Fixes: 4615e5a34b95 ("optee: add FF-A support")
Reported-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
security/keys/trusted-keys/trusted_tee.c