Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 310eb168 authored by Jens Wiklander's avatar Jens Wiklander Committed by Victor Chong
Browse files

BACKPORT: tee: indicate privileged dev in gen_caps



Mirrors the TEE_DESC_PRIVILEGED bit of struct tee_desc:flags into struct
tee_ioctl_version_data:gen_caps as TEE_GEN_CAP_PRIVILEGED in
tee_ioctl_version()

Change-Id: Iebd281e36b45181325da6b7982f045b4642e72d4
Reviewed-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit 059cf566e123ca7eb7434285c6455d7afafb4e02)
Signed-off-by: default avatarVictor Chong <victor.chong@linaro.org>
parent 648c5f26
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -90,8 +90,13 @@ static int tee_ioctl_version(struct tee_context *ctx,
	struct tee_ioctl_version_data vers;

	ctx->teedev->desc->ops->get_version(ctx->teedev, &vers);

	if (ctx->teedev->desc->flags & TEE_DESC_PRIVILEGED)
		vers.gen_caps |= TEE_GEN_CAP_PRIVILEGED;

	if (copy_to_user(uvers, &vers, sizeof(vers)))
		return -EFAULT;

	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#define TEE_MAX_ARG_SIZE	1024

#define TEE_GEN_CAP_GP		(1 << 0)/* GlobalPlatform compliant TEE */
#define TEE_GEN_CAP_PRIVILEGED	(1 << 1)/* Privileged device (for supplicant) */

/*
 * TEE Implementation ID