On Thu, Mar 19, 2015 at 03:30:34PM +0100, Jérôme Forissier wrote: [...]
+static struct tee_desc optee_supp_desc = {
- .name = DRIVER_NAME,
- .ops = &optee_supp_ops,
- .owner = THIS_MODULE,
- .flags = TEE_DESC_PRIVILEDGED,
TEE_DESC_PRIVILEGED
Thanks.
+};
+static int optee_probe(struct platform_device *pdev) +{
- struct optee *optee;
- int ret;
- optee = devm_kzalloc(&pdev->dev, sizeof(*optee), GFP_KERNEL);
- if (!optee)
return -ENOMEM;
- optee->dev = &pdev->dev;
- optee->teedev = tee_register(&optee_desc, &pdev->dev, optee);
- if (!optee->teedev) {
dev_err(&pdev->dev, "could not register OP-TEE TEE driver\n");
OP-TEE driver
Thanks.
+static long tee_ioctl_shm_alloc(struct tee_filp *teefilp,
struct tee_shm_alloc_data __user *udata)
+{
- long ret;
- struct tee_shm_alloc_data data;
- struct tee_shm *shm;
- if (copy_from_user(&data, udata, sizeof(data)))
return -EFAULT;
- /* These are implicit in a user space request */
- data.flags |= TEE_SHM_MAPPED | TEE_SHM_GLOBAL_DMA_BUF;
So, the user is not supposed to set them in the ioctl command? Or it doesn't matter? (I think it's not very good to leave a choice to the application so I would either check they are set or on the contrary make them explicitely reserved and check they are zero).
OK, let's require these to be zero.
-- Regards, Jens