tee: remove flags TEE_IOCTL_SHM_MAPPED and TEE_IOCTL_SHM_DMA_BUF
authorAndrew Davis <afd@ti.com>
Mon, 25 Apr 2022 14:16:17 +0000 (09:16 -0500)
committerJens Wiklander <jens.wiklander@linaro.org>
Tue, 26 Apr 2022 08:17:03 +0000 (10:17 +0200)
These look to be leftover from an early edition of this driver. Userspace
does not need this information. Checking all users of this that I have
access to I have verified no one is using them.

They leak internal use flags out to userspace. Even more they are not
correct anymore after a45ea4efa358. Lets drop these flags before
someone does try to use them for something and they become ABI.

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/tee_core.c
include/uapi/linux/tee.h

index 8aa1a4836b92f3cb3867dfc8a9d9a3dde9973e44..af0f7c603fa46045fd1b4a9ba62ed38a82f1419f 100644 (file)
@@ -302,7 +302,6 @@ static int tee_ioctl_shm_alloc(struct tee_context *ctx,
                return PTR_ERR(shm);
 
        data.id = shm->id;
-       data.flags = shm->flags;
        data.size = shm->size;
 
        if (copy_to_user(udata, &data, sizeof(data)))
@@ -339,7 +338,6 @@ tee_ioctl_shm_register(struct tee_context *ctx,
                return PTR_ERR(shm);
 
        data.id = shm->id;
-       data.flags = shm->flags;
        data.length = shm->size;
 
        if (copy_to_user(udata, &data, sizeof(data)))
index 25a6c534beb1b66713bcdb463ccb52e6179c0d02..23e57164693c4fd89758fc5d8c5a080b9be24b24 100644 (file)
 #define TEE_IOC_MAGIC  0xa4
 #define TEE_IOC_BASE   0
 
-/* Flags relating to shared memory */
-#define TEE_IOCTL_SHM_MAPPED   0x1     /* memory mapped in normal world */
-#define TEE_IOCTL_SHM_DMA_BUF  0x2     /* dma-buf handle on shared memory */
-
 #define TEE_MAX_ARG_SIZE       1024
 
 #define TEE_GEN_CAP_GP         (1 << 0)/* GlobalPlatform compliant TEE */