diff options
author | Arnd Bergmann <arnd@arndb.de> | 2022-02-08 11:48:43 +0300 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2022-02-08 11:48:44 +0300 |
commit | cc0def5b4ed61a262b88c67e6f8ed1a70c52c568 (patch) | |
tree | 3b3f575da7914d60bf8c4f55e5c633c197ec4389 /drivers/tee/optee/ffa_abi.c | |
parent | 78b390bd5657e79f8e60b736f81ac1a3203777ea (diff) | |
parent | 4064c461148ab129dfe5eaeea129b4af6cf4b9b7 (diff) | |
download | linux-cc0def5b4ed61a262b88c67e6f8ed1a70c52c568.tar.xz |
Merge tag 'optee-fixes-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes
OP-TE fixes for v5.17
- Adds error checking in optee_ffa_do_call_with_arg()
- Reintroduces an accidentally lost fix for a memref size check
- Uses bitmap_free() to free memory obtained with bitmap_zalloc()
* tag 'optee-fixes-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee:
optee: add error checks in optee_ffa_do_call_with_arg()
tee: optee: do not check memref size on return from Secure World
optee: Use bitmap_free() to free bitmap
Link: https://lore.kernel.org/r/20220126102609.GA1516258@jade
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/tee/optee/ffa_abi.c')
-rw-r--r-- | drivers/tee/optee/ffa_abi.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/tee/optee/ffa_abi.c b/drivers/tee/optee/ffa_abi.c index 545f61af1248..f2bf6c61197f 100644 --- a/drivers/tee/optee/ffa_abi.c +++ b/drivers/tee/optee/ffa_abi.c @@ -619,9 +619,18 @@ static int optee_ffa_do_call_with_arg(struct tee_context *ctx, .data2 = (u32)(shm->sec_world_id >> 32), .data3 = shm->offset, }; - struct optee_msg_arg *arg = tee_shm_get_va(shm, 0); - unsigned int rpc_arg_offs = OPTEE_MSG_GET_ARG_SIZE(arg->num_params); - struct optee_msg_arg *rpc_arg = tee_shm_get_va(shm, rpc_arg_offs); + struct optee_msg_arg *arg; + unsigned int rpc_arg_offs; + struct optee_msg_arg *rpc_arg; + + arg = tee_shm_get_va(shm, 0); + if (IS_ERR(arg)) + return PTR_ERR(arg); + + rpc_arg_offs = OPTEE_MSG_GET_ARG_SIZE(arg->num_params); + rpc_arg = tee_shm_get_va(shm, rpc_arg_offs); + if (IS_ERR(rpc_arg)) + return PTR_ERR(rpc_arg); return optee_ffa_yielding_call(ctx, &data, rpc_arg); } |