From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 DE0BB38B149 for ; Tue, 7 Jul 2026 06:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783404740; cv=none; b=OKWTbWXjgCzDDKpgREOeeS1rUa4+gcB0mBuqOVubSynOEX/WXpcv2mFO0+SIAo15OFAj1EM9q0fwJv24mbC2wyj/tkyIXubY78BUaOQTw8Slq0Jum2SJ/T0HUH107fq4Usb8AZ8mFYwS+TO3c8meNZQmBCc/VYZL0csRiSpiEzo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783404740; c=relaxed/simple; bh=EfGautIJzT+FUsw/yhzLv9bbZyARVX6CtMelQUoL2G4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FcuCRkADYWRnmx9J43V2/+ZTJAb1OWAKxaDwYujChO6gFrMyfc+CXd+7cwMG4vWvMOVYyH2XNRepe67W40I6BMl1Y3pxVh1LQs1mfKBvpMKQO/sWfgRm5GEty2O20wWZSHY2F7r/hdqpgmxn0JGd740dWaPdHj6UyNdhdA4GU0k= 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=Cpp+n5WE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NXJEWm7e; arc=none smtp.client-ip=205.220.180.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="Cpp+n5WE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NXJEWm7e" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66749GeA2658265 for ; Tue, 7 Jul 2026 06:12:18 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= FfnuyctgLY2Nqkn5CYZ26xnKmCeJR/ZgpKG/zqeI4AU=; b=Cpp+n5WEE7q7AijQ lsDMIsc7oeanuwEl5zVxo4ACIzjfnpzccOFikix9tWTjct1KhrZZbI+ZUrSFen2c ddDLP9enMJjtd6GOT/vk8yB0ABxAa/kdPsAiVayedwApEkDuBmDBIV0H/HsUPm7U 20N82tnQui+gjSdJzCY0P7NJ72/BtK5HbU++yzcmJ/q4v938Z+ow4Reg2+m+Ifwp aS/o8NfI+oHDnVb7yHX2vz3Y6jiIag87x0qH2HuZjkiEteaY5k+jc6cJqHhbddSk U7dW4m5Sl28xxQF2ctOEazSRYUKvU0ri+FDt9n+K/PL2Gtdh7MLlZ1ImQqfjVMG+ Vd9bRw== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f8a3r4c3w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 07 Jul 2026 06:12:17 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-847a483ea41so580785b3a.0 for ; Mon, 06 Jul 2026 23:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783404737; x=1784009537; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FfnuyctgLY2Nqkn5CYZ26xnKmCeJR/ZgpKG/zqeI4AU=; b=NXJEWm7etDIaQSNZ6XQYbuNBruilk9zRDL1YBk3k7rQ+U4XWo/CiTYEj6z8gRhqUUf 75YPlC0JxkU/1KjVrCy8PO1V05Oob6gWawWZauqFXGg3TLI0gzo+ml8KPek3pQgRnq5K iJCWRW6Nbc8Ofm56D3D+JJDVQ14uRGDC6B7IlW+bu7lXrE5ov2oVuNZg7Zy2D086kchS onoZihyt+Yw3ru+dRUnWBBoz89GihEVt+cjoNdoFk0UP+2JyjVfTHs1N2QkExevyk5LD 11sGSvTn2DOtTuQwJz8XOUW8+9cfXvekpXqJ79JTvhs+7gO4O1b7zCjzn3KLtQzl9zVQ wb1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783404737; x=1784009537; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=FfnuyctgLY2Nqkn5CYZ26xnKmCeJR/ZgpKG/zqeI4AU=; b=pu67rosH6EN5zI+em/OrveWKMT8921asyBoVQRoP2UNH3qQNMHwRpsl6T5sDgDCadG RQBoj0IXqRAUTHC75DJ6cMxwGz7L2buQ0fEzj62p/iqSfOFZfO1FYnfUL+dnaElcvYWf he32mNC6017onNU+OaVsmrsB7GHIOz3qUX/iw1U7KC0D+Gh88kGFvwA6iuY2N469G2X7 SNn4IzMkmlIzqNtNwZ8vqxZdqTbxxV8Esp2ZK+LC4VMmA+brSA09KkM1YPZMmlRnRnEz j6gA4GXBFLuGLIh0l5HCO4WZ4OdGiPr01YTWzuzs0pM3sPeSHD6TG8HV8L78kmSUPmk0 IMeQ== X-Forwarded-Encrypted: i=1; AHgh+RpXIm5+KZ4z6rZkGnbF6zYK9i32RaSfMio4V3LVfJYjRwHxDdfHnL8oSuRi7ZztyYju7KBYZ3o0MQDaNwM=@vger.kernel.org X-Gm-Message-State: AOJu0Yyc/HQUQ4gGdN9mttRuaAic2odQL092Lkkx5WxsNO/NS06d4M5x 7KDJfHE3XP7dc3HFlNYIS964KxeA68cIUv4eP49iUF/ANTUgY4erD/asBM7M9rurRvM7PQhLjAb 4PO5LJU+LiM56pjkOR1pnYdjsQFQ6qnIKFwaxBIWHc2/THmJ5C3qn1DZnneFRiovH5a0= X-Gm-Gg: AfdE7cmZvZjmNdKdW/vPazcYhrxG5DW6O2xwFxKbHxNj8O7BZVQmHcIRc2CFl/ytmMW PcQRcWepYZ96gSZ/kh3OlDhIRv6+2NdW0mAiROC0ynNYavvGorsNOoLVOgYsQG8p1ACyVs3mq0n ENd5cGA0cFIj5hWi0QV3jWkyQ2h0B3zNJh9fUdMB520jDHGHz+lpGxRg1kLK4D9bkzpY1nC0VNL H+hYbc//e5GAsrSAsNPvG4PaIjebntoVp/i0BBAz3CZVEO8qfTBByoyQFMYs8yyUfpkhFOwy2IR tCzVgGUwYUNhCF2qevemOV+aJL0/2RNttUxVJI2t0P/0PR5k1UqEvLRq0kx3Q22rzCfXTldr9wX EvSOUck+OW66HkHXb4bOJAgaYI1U4g3QnUeTf X-Received: by 2002:a05:6a00:aa82:b0:847:8791:f54f with SMTP id d2e1a72fcca58-8482f533703mr1165911b3a.29.1783404736708; Mon, 06 Jul 2026 23:12:16 -0700 (PDT) X-Received: by 2002:a05:6a00:aa82:b0:847:8791:f54f with SMTP id d2e1a72fcca58-8482f533703mr1165876b3a.29.1783404736151; Mon, 06 Jul 2026 23:12:16 -0700 (PDT) Received: from hu-hdev-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8480da8bab0sm3299321b3a.8.2026.07.06.23.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 23:12:15 -0700 (PDT) From: Harshal Dev Date: Tue, 07 Jul 2026 11:41:30 +0530 Subject: [PATCH 4/6] tee: Export uuidv5 generation for TEE clients 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: 7bit Message-Id: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-4-f659cbd5d04c@oss.qualcomm.com> References: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-0-f659cbd5d04c@oss.qualcomm.com> In-Reply-To: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-0-f659cbd5d04c@oss.qualcomm.com> To: Jens Wiklander , Sumit Garg , Amirreza Zarrabi , Bjorn Andersson , Konrad Dybcio Cc: Basant Kumar , Apurupa Pattapu , Arun Kumar Neelakantam , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Harshal Dev X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1783404715; l=2841; i=harshal.dev@oss.qualcomm.com; s=20251124; h=from:subject:message-id; bh=EfGautIJzT+FUsw/yhzLv9bbZyARVX6CtMelQUoL2G4=; b=PAw3EDVOOI2OCVEVYzRbl6L3ZuNWff3L3fJ0cAsU43Ep4i6n3ph0JorJ1G1zWS7Zf+gM/XdRH CyhtGsu/djEAA8S/ZMHG0VoY7eTivzh7mMXfGkw26iJBhhqsw4Haey2 X-Developer-Key: i=harshal.dev@oss.qualcomm.com; a=ed25519; pk=SHJ8K4SglF5t7KmfMKXl6Mby40WczSeLs4Qus7yFO7c= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA3MDA1NiBTYWx0ZWRfXzadee0XQ/Hsc ctL9DEztSy1APTBX1Qmp2yiBrCHwb1zLdV0Zwv2mHKKn1wy44TWE5BUWRIIFgZhH/XZV7zPmq0n PEaQnr3TAqf515UvBKTAhdEYlGkJMinmSjiddLCHbDRycl49lb7fp2v4hLLoi+0Jg2sdpgKkHud 6YdEmokUJEbdfoVjZJ9JxQ48sv+jb/w0io/RH8+D+5oBgLRqvXiv9DYixzRo1BXzguvCLpIVsGv uzuVMQxi1ugA5Kq6ExseEgDdxCqlHTkJUoMrwkarxBwGXvEx+gTpJD6cROLqRz54zb3nj70YCSE GgkptelnpF9BrehQ9xd2RnuBgV7Nx3EEVpffvntOx81py1WTdlXOGfenUpTSMBfXY1ntdKJp64y hOfE7XJfs5fEdIQKg6n/CdArW8T6cirGsZhEVYYKvfwkGXnie2bMGjrGlkctsKWELR7eY9gy070 YD84NPnFteLr2jZJVCA== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA3MDA1NiBTYWx0ZWRfX8iBuS7a2dBrT 0BTUaVxcZi4BCzy079C0mamrw2+FeiBlKU7kwrt21pMD0cp1U0R5DzOVYFzEMAv3Gb5F/4Vtzyg mw9t2P5uJCNSOV82IYaSbkXqUPAykeA= X-Proofpoint-GUID: 9OI2cZthTEsH_a_2fL31FI-00z2F9aQN X-Proofpoint-ORIG-GUID: 9OI2cZthTEsH_a_2fL31FI-00z2F9aQN X-Authority-Analysis: v=2.4 cv=OKcXGyaB c=1 sm=1 tr=0 ts=6a4c98c1 cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=_y_UpZ8dDEjReVSEE2UA:9 a=+jEqtf1s3R9VXZ0wqowq2kgwd+I=:19 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-07_01,2026-07-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607070056 Export the uuidv5() function defined in the TEE core to all TEE backends. This enables the TEE backend drivers to generate a UUID for identifying and registering their secure services on the TEE bus. Signed-off-by: Harshal Dev --- drivers/tee/tee_core.c | 9 +++++---- include/linux/tee_core.h | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 0783802fd010..61dd99bbf5f6 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -135,7 +135,7 @@ static int tee_release(struct inode *inode, struct file *filp) } /** - * uuid_v5() - Calculate UUIDv5 + * tee_generate_uuid_v5() - Calculate UUIDv5 * @uuid: Resulting UUID * @ns: Name space ID for UUIDv5 function * @name: Name for UUIDv5 function @@ -146,8 +146,8 @@ static int tee_release(struct inode *inode, struct file *filp) * This implements section (for SHA-1): * 4.3. Algorithm for Creating a Name-Based UUID */ -static void uuid_v5(uuid_t *uuid, const uuid_t *ns, const void *name, - size_t size) +void tee_generate_uuid_v5(uuid_t *uuid, const uuid_t *ns, const void *name, + size_t size) { unsigned char hash[SHA1_DIGEST_SIZE]; struct sha1_ctx ctx; @@ -163,6 +163,7 @@ static void uuid_v5(uuid_t *uuid, const uuid_t *ns, const void *name, uuid->b[6] = (hash[6] & 0x0F) | 0x50; uuid->b[8] = (hash[8] & 0x3F) | 0x80; } +EXPORT_SYMBOL_GPL(tee_generate_uuid_v5); int tee_session_calc_client_uuid(uuid_t *uuid, u32 connection_method, const u8 connection_data[TEE_IOCTL_UUID_LEN]) @@ -228,7 +229,7 @@ int tee_session_calc_client_uuid(uuid_t *uuid, u32 connection_method, goto out_free_name; } - uuid_v5(uuid, &tee_client_uuid_ns, name, name_len); + tee_generate_uuid_v5(uuid, &tee_client_uuid_ns, name, name_len); out_free_name: kfree(name); diff --git a/include/linux/tee_core.h b/include/linux/tee_core.h index f993d5118edd..13807e795880 100644 --- a/include/linux/tee_core.h +++ b/include/linux/tee_core.h @@ -266,6 +266,21 @@ void tee_device_set_dev_groups(struct tee_device *teedev, int tee_session_calc_client_uuid(uuid_t *uuid, u32 connection_method, const u8 connection_data[TEE_IOCTL_UUID_LEN]); +/** + * tee_generate_uuid_v5() - Calculate UUIDv5 + * @uuid: Resulting UUID + * @ns: Name space ID for UUIDv5 function + * @name: Name for UUIDv5 function + * @size: Size of name + * + * UUIDv5 is specific in RFC 4122. + * + * This implements section (for SHA-1): + * 4.3. Algorithm for Creating a Name-Based UUID + */ +void tee_generate_uuid_v5(uuid_t *uuid, const uuid_t *ns, const void *name, + size_t size); + /** * struct tee_shm_pool - shared memory pool * @ops: operations -- 2.34.1