Skip to content

Commit 2a7e842

Browse files
authored
Implements LOGIN_APPLICATION and LOGIN_USER_APPLICATION
1 parent 4da2533 commit 2a7e842

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

drivers/tee/tee_core.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,38 @@ int tee_session_calc_client_uuid(uuid_t *uuid, u32 connection_method,
254254
}
255255
break;
256256

257+
case TEE_IOCTL_LOGIN_APPLICATION:
258+
{
259+
char path[512];
260+
if (get_cmdline(current, path, sizeof(path)) >= sizeof(path)) {
261+
rc = -E2BIG;
262+
goto out_free_name;
263+
}
264+
name_len = snprintf(name, TEE_UUID_NS_NAME_SIZE, "path=%s",
265+
path);
266+
if (name_len >= TEE_UUID_NS_NAME_SIZE) {
267+
rc = -E2BIG;
268+
goto out_free_name;
269+
}
270+
}
271+
break;
272+
273+
case TEE_IOCTL_LOGIN_USER_APPLICATION:
274+
{
275+
char path[512];
276+
if (get_cmdline(current, path, sizeof(path)) >= sizeof(path)) {
277+
rc = -E2BIG;
278+
goto out_free_name;
279+
}
280+
name_len = snprintf(name, TEE_UUID_NS_NAME_SIZE, "uid=%x,path=%s",
281+
current_euid().val, path);
282+
if (name_len >= TEE_UUID_NS_NAME_SIZE) {
283+
rc = -E2BIG;
284+
goto out_free_name;
285+
}
286+
}
287+
break;
288+
257289
default:
258290
rc = -EINVAL;
259291
goto out_free_name;

0 commit comments

Comments
 (0)