From nobody Thu Oct 2 20:42:12 2025 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75D292797AF for ; Fri, 12 Sep 2025 04:07:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757650080; cv=none; b=tuOGmVcQCN4WjqdKzpk4D+pmCFBeRVjmPpyKJg9Xo1JX05atSCGKjNHaWKZKN1gtbc3cTSwPvMIfgLUHvSG4PBOykoFw8IB33Tx+6jOok9/DTBNYqUWNOx7o3kwcLCi0DvPUVvh0o+gFmPXulRm/GjVkjMlmir7SQ164VTTGRRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757650080; c=relaxed/simple; bh=dH0ZgyEIi9MLQbBH1YZT3jInv+ksN05U4tuNZu/+DGU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dEjhGUzBWpf3wuXj0RqnL0iV5lCOKalYj+Qi493K+BAaz2us7+Jgms1t7Ehg0EpLe8qFfYc59aXsWPyJa90sFoI6by/fZqHKHcJwz10xzDkX7f97xcMtKTd6eG1x0YMC+JK7CY9AE4cn4G9YpvHFYxHaFQKw3XG1o7vq8sdFCnU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=i7ozhcct; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="i7ozhcct" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58BKMpfo016084 for ; Fri, 12 Sep 2025 04:07:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= AXis+TKbeHlsETu6aJDXQIQJ0AdwSh5Mr8oFjXt+FJ0=; b=i7ozhcct2gChLCGu 36P7U7OM2dgrR2IMKk5WEPG8Kcd3eAuK+QqTb6uoqGA0f44RgKnBLav6hKUwRf49 tVQw2J9xZPdRE6cXp6yWeKEoPhAfbWJO1cmtNy2Awat0byzR26sFl/7LhWVoYDph xWp5v5kDLvZFCDpBRGyAnLAOksWsaeZHuzXxrZahuraZkGENR/B7FKuVGAq+WH9F TPeRkto4oQV4YKIOytqe+DS1nKShLja4xHopSW6q8NwARMbc3l3H/JZGbf/rvpEp D4wAEVqfXjSBPT7AkHVEqvOnavpasnSPGLsNNUOpMTjkduNCQl6sgDehSm6E1YpU quRhdA== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 491t386jwn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 12 Sep 2025 04:07:57 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-b4fb25c2e56so1034310a12.3 for ; Thu, 11 Sep 2025 21:07:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757650077; x=1758254877; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AXis+TKbeHlsETu6aJDXQIQJ0AdwSh5Mr8oFjXt+FJ0=; b=L/welR80DJdVvZQdyV3g1RUlDnh8kBjzhEPsxwUAAhrhU+H9D4OAa0yP+V6UCM8XfZ OyyZyov8uSlA50V9JJ5DJUZKdsH3Tg70oCjC4q7+gs9Tk3qGvxeD+u4fOx0vmAlFCrrV MJr6EvrQAIxIzRif/8zYcy6XwJCBsbn5GRE3eDWKgZfXN8/3zdfgrwjn+04cMpEtZRFA j+IxPxaB2+mzuRwGYQ9E6bgeg7R8Y9m5Vo+wwt93kkWoQYaVvIFop3o5jKRy+HDQwfaV PwB1Cab2wez2kSdtFJM03lKBkhBZ9ov6qbUJoNX3VseDBNxUfxHba5eqp1RjbmPVCq3K C4tw== X-Forwarded-Encrypted: i=1; AJvYcCVT4NVWt23wwi6par00sY1gQKpcBCjjHW3vY2h85oX7sn3myrotZpuGV9Y+Dfz/YgKNEiNIILd0ZGYQuME=@vger.kernel.org X-Gm-Message-State: AOJu0YzkfCWvEsjF42o3+LWYhRilsmNHt9Y0PH77xpwa5knDJHtReGN1 ZlArzov2JZZKdn6V5tq8sETTkYgAmbeWQrC2ak1zBMffQCdoSdtoRW/lorQLLv4K/qdT+aITz1N NdRHzG7ioVeRCpvov9Zt7zufmm83Hs/qlx17go9yGOpapWE3AuEpivFpIXo3LV2ARnw== X-Gm-Gg: ASbGnctmdwnlQFQF1JaeizUlIocZrAaH5UbbHRUJFWgU96/sb3AaKpWbnBmEbUtYowh m/KYvw6L3hcd702dvNyFKJhzMyPhEaNTUJ7FiUh8lTEcsGj0kM26oRlyR79blMUB4Up327BKtOK 7oy2jJigXUrdQFAt0Bn8CH/n1EnyhQzR5fgqrXoYqvoJ4DX6MOmE/62qVg943lRSxkygRk33/N0 WwxuZdU4bwGLOrOhSxpxaDrwdU1G0rRJf4RTIc7ZGoIHmVhVMJ0GSc47Ix//yLHSkah/CScvyJZ WoHU4J0YZfWkVdgx/eI/bZhU47x6vxlNCIo72U78RmCli81qm3rSXYOEhlAxrkpwCEYJm+/eSUr qSFAHWkGgHnSbV5kZKRG2Rvs= X-Received: by 2002:a05:6a20:a122:b0:246:f1:bec3 with SMTP id adf61e73a8af0-2602c90957emr2108646637.42.1757650076659; Thu, 11 Sep 2025 21:07:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxe5EoLzwK1flFNkqEySnmp84+KIiU9R2EXKsP4DHQUWw+0urgcTcrsUJubWjDignI/mmv0Q== X-Received: by 2002:a05:6a20:a122:b0:246:f1:bec3 with SMTP id adf61e73a8af0-2602c90957emr2108597637.42.1757650076158; Thu, 11 Sep 2025 21:07:56 -0700 (PDT) Received: from hu-azarrabi-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b54ad5e168fsm690960a12.13.2025.09.11.21.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Sep 2025 21:07:55 -0700 (PDT) From: Amirreza Zarrabi Date: Thu, 11 Sep 2025 21:07:45 -0700 Subject: [PATCH v12 06/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250911-qcom-tee-using-tee-ss-without-mem-obj-v12-6-17f07a942b8d@oss.qualcomm.com> References: <20250911-qcom-tee-using-tee-ss-without-mem-obj-v12-0-17f07a942b8d@oss.qualcomm.com> In-Reply-To: <20250911-qcom-tee-using-tee-ss-without-mem-obj-v12-0-17f07a942b8d@oss.qualcomm.com> To: Jens Wiklander , Sumit Garg , Bjorn Andersson , Konrad Dybcio , Bartosz Golaszewski , Apurupa Pattapu , Kees Cook , "Gustavo A. R. Silva" , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= Cc: Harshal Dev , linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-doc@vger.kernel.org, Amirreza Zarrabi , Sumit Garg , Neil Armstrong X-Mailer: b4 0.13.0 X-Proofpoint-ORIG-GUID: sihj6pSWQPOyEUq_hAMBr9PqCSki3hbI X-Proofpoint-GUID: sihj6pSWQPOyEUq_hAMBr9PqCSki3hbI X-Authority-Analysis: v=2.4 cv=NdLm13D4 c=1 sm=1 tr=0 ts=68c39c9d cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=COk6AnOGAAAA:8 a=fw-SQdjKjSnpQ1BqlTsA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 a=cvBusfyB2V15izCimMoJ:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDA2NiBTYWx0ZWRfX9mOkaVO3LCJN e9xMndkQ1j0orzLFhFBGgh15ZyjGVfz7hA/y+Qrk8UQ8QAy9Gp4ZWYT1GtB6cKSAZToaMyBnoFr VH26acPJIo4M9jDahCHL2En2HqY1CLSMthPPUSZ0D0JEtNWj4PwZoo/FNFXa0F5jW/vmlkzpGEq F2sTl6EqJjXT5zobcanIz/gDRD0NYZ+mBS435T7kdajhtaRN1w2ghlIoV/DiUTSJqvC4fwxBchV RH8HrAaHoIYxVXbKwl17RhQZR+UH0QPxeHYsBbq2c/fp6846CDKsKqvpJSPF1CnoYB1eotPgy7A Pb7+hh8HnU45MiauQeLgSVEFWsd5oQhF3sqJ980NQghGV1/nopKEVTdWllABJtNMzqNaaT5CSSX axD7G6zH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-12_01,2025-09-11_02,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 clxscore=1015 impostorscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509080066 The TEE subsystem allows session-based access to trusted services, requiring a session to be established to receive a service. This is not suitable for an environment that represents services as objects. An object supports various operations that a client can invoke, potentially generating a result or a new object that can be invoked independently of the original object. Add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INPUT/OUTPUT/INOUT to represent an object. Objects may reside in either TEE or userspace. To invoke an object in TEE, introduce a new ioctl. Use the existing SUPPL_RECV and SUPPL_SEND to invoke an object in userspace. Reviewed-by: Sumit Garg Tested-by: Neil Armstrong Tested-by: Harshal Dev Signed-off-by: Amirreza Zarrabi --- drivers/tee/tee_core.c | 85 ++++++++++++++++++++++++++++++++++++++++++++= ++++ include/linux/tee_core.h | 4 +++ include/linux/tee_drv.h | 6 ++++ include/uapi/linux/tee.h | 41 +++++++++++++++++++---- 4 files changed, 130 insertions(+), 6 deletions(-) diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 2dc36b501ce0..b8f24ff14bd5 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -450,6 +450,7 @@ static int params_from_user(struct tee_context *ctx, st= ruct tee_param *params, switch (ip.attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) { case TEE_IOCTL_PARAM_ATTR_TYPE_NONE: case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT: + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_OUTPUT: break; case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT: case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT: @@ -468,6 +469,11 @@ static int params_from_user(struct tee_context *ctx, s= truct tee_param *params, return -EFAULT; =20 break; + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INPUT: + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INOUT: + params[n].u.objref.id =3D ip.a; + params[n].u.objref.flags =3D ip.b; + break; case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT: case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT: case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT: @@ -506,6 +512,12 @@ static int params_to_user(struct tee_ioctl_param __use= r *uparams, if (put_user((u64)p->u.ubuf.size, &up->b)) return -EFAULT; break; + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_OUTPUT: + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INOUT: + if (put_user(p->u.objref.id, &up->a) || + put_user(p->u.objref.flags, &up->b)) + return -EFAULT; + break; case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT: case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT: if (put_user((u64)p->u.memref.size, &up->b)) @@ -658,6 +670,66 @@ static int tee_ioctl_invoke(struct tee_context *ctx, return rc; } =20 +static int tee_ioctl_object_invoke(struct tee_context *ctx, + struct tee_ioctl_buf_data __user *ubuf) +{ + int rc; + size_t n; + struct tee_ioctl_buf_data buf; + struct tee_ioctl_object_invoke_arg __user *uarg; + struct tee_ioctl_object_invoke_arg arg; + struct tee_ioctl_param __user *uparams =3D NULL; + struct tee_param *params =3D NULL; + + if (!ctx->teedev->desc->ops->object_invoke_func) + return -EINVAL; + + if (copy_from_user(&buf, ubuf, sizeof(buf))) + return -EFAULT; + + if (buf.buf_len > TEE_MAX_ARG_SIZE || + buf.buf_len < sizeof(struct tee_ioctl_object_invoke_arg)) + return -EINVAL; + + uarg =3D u64_to_user_ptr(buf.buf_ptr); + if (copy_from_user(&arg, uarg, sizeof(arg))) + return -EFAULT; + + if (sizeof(arg) + TEE_IOCTL_PARAM_SIZE(arg.num_params) !=3D buf.buf_len) + return -EINVAL; + + if (arg.num_params) { + params =3D kcalloc(arg.num_params, sizeof(struct tee_param), + GFP_KERNEL); + if (!params) + return -ENOMEM; + uparams =3D uarg->params; + rc =3D params_from_user(ctx, params, arg.num_params, uparams); + if (rc) + goto out; + } + + rc =3D ctx->teedev->desc->ops->object_invoke_func(ctx, &arg, params); + if (rc) + goto out; + + if (put_user(arg.ret, &uarg->ret)) { + rc =3D -EFAULT; + goto out; + } + rc =3D params_to_user(uparams, arg.num_params, params); +out: + if (params) { + /* Decrease ref count for all valid shared memory pointers */ + for (n =3D 0; n < arg.num_params; n++) + if (tee_param_is_memref(params + n) && + params[n].u.memref.shm) + tee_shm_put(params[n].u.memref.shm); + kfree(params); + } + return rc; +} + static int tee_ioctl_cancel(struct tee_context *ctx, struct tee_ioctl_cancel_arg __user *uarg) { @@ -713,6 +785,12 @@ static int params_to_supp(struct tee_context *ctx, ip.b =3D p->u.ubuf.size; ip.c =3D 0; break; + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INPUT: + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INOUT: + ip.a =3D p->u.objref.id; + ip.b =3D p->u.objref.flags; + ip.c =3D 0; + break; case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT: case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT: case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT: @@ -825,6 +903,11 @@ static int params_from_supp(struct tee_param *params, = size_t num_params, return -EFAULT; =20 break; + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_OUTPUT: + case TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INOUT: + p->u.objref.id =3D ip.a; + p->u.objref.flags =3D ip.b; + break; case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT: case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT: /* @@ -907,6 +990,8 @@ static long tee_ioctl(struct file *filp, unsigned int c= md, unsigned long arg) return tee_ioctl_open_session(ctx, uarg); case TEE_IOC_INVOKE: return tee_ioctl_invoke(ctx, uarg); + case TEE_IOC_OBJECT_INVOKE: + return tee_ioctl_object_invoke(ctx, uarg); case TEE_IOC_CANCEL: return tee_ioctl_cancel(ctx, uarg); case TEE_IOC_CLOSE_SESSION: diff --git a/include/linux/tee_core.h b/include/linux/tee_core.h index 456a940d4710..1f3e5dad6d0d 100644 --- a/include/linux/tee_core.h +++ b/include/linux/tee_core.h @@ -83,6 +83,7 @@ struct tee_device { * @close_session: close a session * @system_session: declare session as a system session * @invoke_func: invoke a trusted function + * @object_invoke_func: invoke a TEE object * @cancel_req: request cancel of an ongoing invoke or open * @supp_recv: called for supplicant to get a command * @supp_send: called for supplicant to send a response @@ -108,6 +109,9 @@ struct tee_driver_ops { int (*invoke_func)(struct tee_context *ctx, struct tee_ioctl_invoke_arg *arg, struct tee_param *param); + int (*object_invoke_func)(struct tee_context *ctx, + struct tee_ioctl_object_invoke_arg *arg, + struct tee_param *param); int (*cancel_req)(struct tee_context *ctx, u32 cancel_id, u32 session); int (*supp_recv)(struct tee_context *ctx, u32 *func, u32 *num_params, struct tee_param *param); diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 7915e8869cbd..88a6f9697c89 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -87,6 +87,11 @@ struct tee_param_ubuf { size_t size; }; =20 +struct tee_param_objref { + u64 id; + u64 flags; +}; + struct tee_param_value { u64 a; u64 b; @@ -97,6 +102,7 @@ struct tee_param { u64 attr; union { struct tee_param_memref memref; + struct tee_param_objref objref; struct tee_param_ubuf ubuf; struct tee_param_value value; } u; diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h index 0e3b735dcfca..9abb0f299549 100644 --- a/include/uapi/linux/tee.h +++ b/include/uapi/linux/tee.h @@ -48,8 +48,10 @@ #define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplican= t) */ #define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory = */ #define TEE_GEN_CAP_MEMREF_NULL (1 << 3)/* NULL MemRef support */ +#define TEE_GEN_CAP_OBJREF (1 << 4)/* Supports generic object reference */ =20 -#define TEE_MEMREF_NULL (__u64)(-1) /* NULL MemRef Buffer */ +#define TEE_MEMREF_NULL ((__u64)(-1)) /* NULL MemRef Buffer */ +#define TEE_OBJREF_NULL ((__u64)(-1)) /* NULL ObjRef Object */ =20 /* * TEE Implementation ID @@ -158,6 +160,13 @@ struct tee_ioctl_buf_data { #define TEE_IOCTL_PARAM_ATTR_TYPE_UBUF_OUTPUT 9 #define TEE_IOCTL_PARAM_ATTR_TYPE_UBUF_INOUT 10 /* input and output */ =20 +/* + * These defines object reference parameters. + */ +#define TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INPUT 11 +#define TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_OUTPUT 12 +#define TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF_INOUT 13 + /* * Mask for the type part of the attribute, leaves room for more types */ @@ -195,15 +204,16 @@ struct tee_ioctl_buf_data { * @attr: attributes * @a: if a memref, offset into the shared memory object, * else if a ubuf, address of the user buffer, - * else a value parameter - * @b: if a memref or ubuf, size of the buffer, else a value parameter + * else if an objref, object identifier, else a value parameter + * @b: if a memref or ubuf, size of the buffer, + * else if objref, flags for the object, else a value parameter * @c: if a memref, shared memory identifier, else a value parameter * * @attr & TEE_PARAM_ATTR_TYPE_MASK indicates if memref, ubuf, or value is * used in the union. TEE_PARAM_ATTR_TYPE_VALUE_* indicates value, - * TEE_PARAM_ATTR_TYPE_MEMREF_* indicates memref, and TEE_PARAM_ATTR_TYPE_= UBUF_* - * indicates ubuf. TEE_PARAM_ATTR_TYPE_NONE indicates that none of the mem= bers - * are used. + * TEE_PARAM_ATTR_TYPE_MEMREF_* indicates memref, TEE_PARAM_ATTR_TYPE_UBUF= _* + * indicates ubuf, and TEE_PARAM_ATTR_TYPE_OBJREF_* indicates objref. + * TEE_PARAM_ATTR_TYPE_NONE indicates that none of the members are used. * * Shared memory is allocated with TEE_IOC_SHM_ALLOC which returns an * identifier representing the shared memory object. A memref can reference @@ -442,4 +452,23 @@ struct tee_ioctl_shm_register_fd_data { * munmap(): unmaps previously shared memory */ =20 +/** + * struct tee_ioctl_invoke_func_arg - Invokes an object in a Trusted Appli= cation + * @id: [in] Object id + * @op: [in] Object operation, specific to the object + * @ret: [out] return value + * @num_params: [in] number of parameters following this struct + */ +struct tee_ioctl_object_invoke_arg { + __u64 id; + __u32 op; + __u32 ret; + __u32 num_params; + /* num_params tells the actual number of element in params */ + struct tee_ioctl_param params[]; +}; + +#define TEE_IOC_OBJECT_INVOKE _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 10, \ + struct tee_ioctl_buf_data) + #endif /*__TEE_H*/ --=20 2.34.1