Skip to content

Commit 7468bed

Browse files
committed
Merge tag 'optee-fix-for-v5.13' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes
OP-TEE use export_uuid() to copy UUID * tag 'optee-fix-for-v5.13' of git://git.linaro.org/people/jens.wiklander/linux-tee: optee: use export_uuid() to copy client UUID Link: https://lore.kernel.org/r/20210518100712.GA449561@jade Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents 2f3e4eb + 673c7aa commit 7468bed

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

drivers/tee/optee/call.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ int optee_open_session(struct tee_context *ctx,
220220
struct optee_msg_arg *msg_arg;
221221
phys_addr_t msg_parg;
222222
struct optee_session *sess = NULL;
223+
uuid_t client_uuid;
223224

224225
/* +2 for the meta parameters added below */
225226
shm = get_msg_arg(ctx, arg->num_params + 2, &msg_arg, &msg_parg);
@@ -240,10 +241,11 @@ int optee_open_session(struct tee_context *ctx,
240241
memcpy(&msg_arg->params[0].u.value, arg->uuid, sizeof(arg->uuid));
241242
msg_arg->params[1].u.value.c = arg->clnt_login;
242243

243-
rc = tee_session_calc_client_uuid((uuid_t *)&msg_arg->params[1].u.value,
244-
arg->clnt_login, arg->clnt_uuid);
244+
rc = tee_session_calc_client_uuid(&client_uuid, arg->clnt_login,
245+
arg->clnt_uuid);
245246
if (rc)
246247
goto out;
248+
export_uuid(msg_arg->params[1].u.octets, &client_uuid);
247249

248250
rc = optee_to_msg_param(msg_arg->params + 2, arg->num_params, param);
249251
if (rc)

drivers/tee/optee/optee_msg.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <linux/types.h>
1010

1111
/*
12-
* This file defines the OP-TEE message protocol used to communicate
12+
* This file defines the OP-TEE message protocol (ABI) used to communicate
1313
* with an instance of OP-TEE running in secure world.
1414
*
1515
* This file is divided into two sections.
@@ -144,9 +144,10 @@ struct optee_msg_param_value {
144144
* @tmem: parameter by temporary memory reference
145145
* @rmem: parameter by registered memory reference
146146
* @value: parameter by opaque value
147+
* @octets: parameter by octet string
147148
*
148149
* @attr & OPTEE_MSG_ATTR_TYPE_MASK indicates if tmem, rmem or value is used in
149-
* the union. OPTEE_MSG_ATTR_TYPE_VALUE_* indicates value,
150+
* the union. OPTEE_MSG_ATTR_TYPE_VALUE_* indicates value or octets,
150151
* OPTEE_MSG_ATTR_TYPE_TMEM_* indicates @tmem and
151152
* OPTEE_MSG_ATTR_TYPE_RMEM_* indicates @rmem,
152153
* OPTEE_MSG_ATTR_TYPE_NONE indicates that none of the members are used.
@@ -157,6 +158,7 @@ struct optee_msg_param {
157158
struct optee_msg_param_tmem tmem;
158159
struct optee_msg_param_rmem rmem;
159160
struct optee_msg_param_value value;
161+
u8 octets[24];
160162
} u;
161163
};
162164

0 commit comments

Comments
 (0)