From mboxrd@z Thu Jan 1 00:00:00 1970 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 6C2F43B8D40 for ; Wed, 22 Jul 2026 06:59:57 +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=1784703598; cv=none; b=jvGsyNFsP7asnlXoddUWSbDrsA1Tg6cB7FMD8kV8E8dFk53akbK2f6MtmHnmqP53nVKqGeOFD2vfGWGNjFmOU+uBUDGWKxLptA4rj5/DVjAFCoxi6Aj+RnxIuTog5hoSs/MwwxsjplYXI9EprWacCK2tb+Y4GcaZHzZH59WoEuY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784703598; c=relaxed/simple; bh=UutwisPxLmXUS8raj8VcKR5HsTjTxGdmVUYtVk2b150=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jSKDKhwH6BEPJjcO1J5l+FSAs2SatDCHMOSSzT0A1l0alTPn3p8Ieu1RgBGiOapTVcxet9KrRDBtefiyRhhxGZDiKlxnY7I0iCyTZmLA2EyhAkbe8Mb7RkfY2TRwy73s47C7Yxih6KgrQ8O9Lz8TBsqSSIJWZUp5jD+DppNoxaQ= 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=nUbNWyQu; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OzBK9sif; 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="nUbNWyQu"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OzBK9sif" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66M53bHL3767556 for ; Wed, 22 Jul 2026 06:59:56 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= DN7n/bdfkW6wuLU+Ox37xcY8Be/ZEVNLsXfifpOhL+0=; b=nUbNWyQumK/DBmof ASV/5Cgecfp7vw6pRDIrtK0EYgydzKrCfa0aRoZF+9toVz4+GSPKwov0nLunkk8i /XTTrfT2uz9/qogFAy11SXiDSmmp8b5e8zhJXvGhFrxDPCL6JB8hlSw08bfKi3vJ jLiaf4iAFe82/RU0aQ4pWZxhctj3hgY8mxPp5QDvp9NZbrVq0y32j5ORByL2Ph18 8uaQNy/5KllxXFiFkeL9J2pR4lFFowwcE32Kympw/QztfusgTZmkwPwNQqAoyUXw k2o7DwWbkLqW0VcwSIAv+a/c/HBTDcb8s//vIcsIV1LbJfgOcqoa7nqbIMJ9vQnt eGdrhw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fjnu4rrak-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 22 Jul 2026 06:59:56 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2ccd1958e8fso123695405ad.2 for ; Tue, 21 Jul 2026 23:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784703596; x=1785308396; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DN7n/bdfkW6wuLU+Ox37xcY8Be/ZEVNLsXfifpOhL+0=; b=OzBK9sifXP63963fzL0qExpeb3uOAYEEitEn3oXr59FQoKjsFTqzNKRs6cGCEqwFel aYJtNCyF56FjCnOd2qLOayjRi0Vh7Rub2I9PeqslFF24kPWfeMeItDVX2zW62fUn/R7B LRP4Tv06sE4s9xnmdU0wuiGL0GqGet1DI520LwLCB5O1XWatXBB8n6MuAZOry0tG3lvb JQnoiMuofMqO78tqbSqIIzd6D4/eW3kTWoO7ca1i7kSEWe3imEAfiUQxBZ126X8a+G6l ylB+60YcSLokyHccQLdgGIO2sGJD/X6uM+EO/JoFYEn3kIyRpwQI+kNRPTBvXAqWjCE9 j1MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784703596; x=1785308396; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DN7n/bdfkW6wuLU+Ox37xcY8Be/ZEVNLsXfifpOhL+0=; b=qz5zNxHHZhWLndflf0qEVCt85kwz5pZOqsDthr/I/B7WbINc2ODmJC25+HQWR5oaof zZUy3J5pNn1dGBV+PMHN80EWtEYLXmUQ3RKeGgkeU7csqNhO9e0xo1A5mxBxCiwWR2mN yi3TmUVOnIDcVnxKkQVhu02OoU8UOcy7X+Hv3Ds3rzkkcZ6BqCUOwTO5Kl9RBclrKSeO NNdWPk5G6GUDZonIMcFkwvHKLv9Fx95AAzZOw+ICqkqS4GEamo/y5QT33znPdTnaIVna mkcuNyzaQHSBqBhdxqKHUFl+XX4VwKvQwC4mI6VU4Sn9kCyBmYP0jkMOst30Z0I81ZSQ T9ag== X-Forwarded-Encrypted: i=1; AHgh+RoERsm9ltCQyhNhsW1gvkUkh3TspwXT8Azk1JtHbvszbUNbrxU7RGmLfcaOEh8SGfnkrUInm63mMb8bLb0=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7Rbtm/iUpmwcfzARYlm/sz28NzelYgMf+DgbAJY0e2hPKx/vh WX4v0SXKog/FZ3csNv0v34Lnc/ed1pHvFrWKKNe6U52+mruxjCAsJ7jaOsOEGCEBbR4EMZ+tgRV lQni1jJUZOxvaPOrYG/8IruIdsLOhrFUys7t05XGxljfVuAaPVZJmjs5xDqMsRU4IFzo= X-Gm-Gg: AR+sD10Q9LTDxY2pVYyIw1p1GtvuoW8rVARMeEzpdnAgdyTSmAZu7hGxbYZdXq57xJA ex+j1jO6kd3CoZ52Pg65eysSf8Q1iMv8dKH34pKAKfC9exABvu8++7yjiZMQLRuJKOa978vdbk8 quWpL6oNWQv+77SukXNz9dPLL+Kb3o5otCZYOdd3J/KmQmPbQ3gVKd1zBe0QYEy+g27MC4PaDD+ +NR5Pn2z8ASKGj3u/u9mfLFlcZzrVmDi1tEpLOVxsetLDpxUrXuqA/93yJfaag9h6Fsd5FKLB6o l6teu122Qy/KVUf+Qu8uFV6e5pw+S97+WVNr1/3BCh2QjKbp16xVRP/X2Ffult8zQfIID1nUlWK wPMIA8rOXh9J98YYFpjSl150Wpw== X-Received: by 2002:a17:902:d48a:b0:2ca:b8fd:f31 with SMTP id d9443c01a7336-2cf34889935mr241887125ad.15.1784703595872; Tue, 21 Jul 2026 23:59:55 -0700 (PDT) X-Received: by 2002:a17:902:d48a:b0:2ca:b8fd:f31 with SMTP id d9443c01a7336-2cf34889935mr241886725ad.15.1784703595269; Tue, 21 Jul 2026 23:59:55 -0700 (PDT) Received: from hu-hdev-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf8efd88f7sm9428935ad.22.2026.07.21.23.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 23:59:54 -0700 (PDT) From: Harshal Dev Date: Wed, 22 Jul 2026 12:29:15 +0530 Subject: [PATCH v2 4/6] tee: Export uuidv5 generation for TEE backends 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: <20260722-qcom_uefisecapp_migrate_qcomtee-v2-4-b8a8fcbe4211@oss.qualcomm.com> References: <20260722-qcom_uefisecapp_migrate_qcomtee-v2-0-b8a8fcbe4211@oss.qualcomm.com> In-Reply-To: <20260722-qcom_uefisecapp_migrate_qcomtee-v2-0-b8a8fcbe4211@oss.qualcomm.com> To: Jens Wiklander , 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=1784703569; l=2841; i=harshal.dev@oss.qualcomm.com; s=20251124; h=from:subject:message-id; bh=UutwisPxLmXUS8raj8VcKR5HsTjTxGdmVUYtVk2b150=; b=e3840ElqGSsbHCB/vLaMQ0i5nkwNtX7qIXk4AQ5l3SYykOH+T0ZsgFDH5wsLcBe09Pbg1b0lV ojALYmxiZ/7DcaLepple6Z8D1EJcn3Wc9nlMRylWSvsb0nWaz2EIMLn X-Developer-Key: i=harshal.dev@oss.qualcomm.com; a=ed25519; pk=SHJ8K4SglF5t7KmfMKXl6Mby40WczSeLs4Qus7yFO7c= X-Proofpoint-GUID: -oyRb4NHvDFS0FzaCo4DqHrnBc4x1ikx X-Authority-Analysis: v=2.4 cv=KLhqylFo c=1 sm=1 tr=0 ts=6a606a6c c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0/zHZKo= 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-22_02,2026-07-21_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607220063 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 bb418490f3af..df88727b3680 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 bcb5418d6fdc..a3f4f88b8423 100644 --- a/include/linux/tee_core.h +++ b/include/linux/tee_core.h @@ -272,6 +272,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