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 712101C862E for ; Fri, 5 Dec 2025 14:11:42 +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=1764943905; cv=none; b=C7UD+gtYZcxlcHLc6vX5zKGeAieIrYgfCmrg4YQe7/zSUL3cpx+Dbml3hBS/5/yj+n87WtEAlQ33GSU24dylX/FsB1xvUTvh7V9KG1071dZDm9pDpXjEzMu18i69OAWrrrBcZxak3Dv64rA1gYJcEpQlhAktox13/kXCQuv0FiA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764943905; c=relaxed/simple; bh=R8Qaz7v+v6s04gdiMmkZET0OLVqdnzCiQHdy8Jh/eME=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cdjSCLaIBa3XSF/0Zshb2m+sgRzHauzE+pjEbGzm81sBhW0UkuWJsclDS//SSkGxaneW+8PQN2nM+UaRdbN9vG0XXlApthnOE9MwhqoOwly5cTjU7efosH6VQDvrXQk/G8IoYCkI3UyvuJXU9CqtZqBFpGvuo5cMwUYrm4vZlow= 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=c1S72kir; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Q66uHMzs; 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="c1S72kir"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Q66uHMzs" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5B580T4x2516907 for ; Fri, 5 Dec 2025 14:11:40 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= QU8RQH9lmiI1HiYYmsKFuuvMvSYQmCzAce1xUwg2TNI=; b=c1S72kirhAvVDQnc pRtQKH5eNiROWLzDlffYD2GeRYyv2yPIvTELQ6dweHVudlMDZZOF84A8rvriCM8V RqSTUFvAUyP1z9U9SX3uodCNL0biuJneVAhOBZkkrd4b6ATPUGxA71qCGRtF9Vly bava4ugsWKNXMX0JtqjTjYp9tGmL/ENdydTR1d50Lj8SQEvlC6evg6HhEL0Ww7AP Bu8lotolOnrePXsjoUMi2wwynBccOJzAwpquH/pcNx9POxUGzOy5cn6PNghi6Ihb 01Ml18FCb6LtCL/3b2gyDwwejRTqexneVpTUk9gsbeGlm13OeROSKQFwwr/Glczf 522kVQ== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4auj7n2d7a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 05 Dec 2025 14:11:40 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-342701608e2so2300488a91.1 for ; Fri, 05 Dec 2025 06:11:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1764943899; x=1765548699; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QU8RQH9lmiI1HiYYmsKFuuvMvSYQmCzAce1xUwg2TNI=; b=Q66uHMzshw7fUnc49exy9yU1HyfOtFKi7+GhpP3thi+V4U3AkZwsqKJ1oQoONuxpZC i3Xm5162BUJZ/U2DMgJpCDaQF+f8JUQjK8GkX7dj+uVP82Ofhephq/0yFiRonDP33quk 4hFt9QqgIvvIVfFynWupMVRpLfqRa/HqktAN3irxB3YsTM0JVUnPVuDW/NTfPkiboR98 dk6+YItO+IDPAoIN5kB9ssISPZsVRqcMbUOr6ercqtbUlmu8N9F3wBzF/P9P3bgKQttw oVbJTd33Fn9PYaALrAfwS44byPUjtJ7TFo4gPhEJIgKL5nPbN3Q35FYpjtVtC3NpKcJ7 wz5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764943899; x=1765548699; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QU8RQH9lmiI1HiYYmsKFuuvMvSYQmCzAce1xUwg2TNI=; b=r/GZjopA1a+Cbk/ZW90csgXF+BNhyG0mpRjs4JezwiAc/Ao1RVb4nmROyhYuQzDObt qTOw8AMf4/7j7Wo8Hjc00ZWLduUhFyOYgkZJvY0gMXvLLGw2N/sApxPdgVU+JABjNAmQ 2TwRUNkJ8/l2CVFaXtZr8uvZPQ3ggJpHQ9sCkgjNja5GNCJew0dpNs4pvMEV0cVzseov 4e+mD4kty+ahHy2CFraSt3AK7HLgETlxxoPG4IuwOiJShAFe8HkOf0XfE/8z81kBjfHO EqM65OCvpE6SQdZ5hdnEr2k0Ta5e0kTzy8kcD7rJi/wLgO9deyPHNzOMi6NzLooAwHjb vHXQ== X-Forwarded-Encrypted: i=1; AJvYcCXhW6DXr0iaJ/p1w5e4w69opJ6u1xGb9cFYzIkqVX9h1gNSNr8s2FEV+FXwZm1n292Uhj+IjBa/Z5gUlYU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6Wd+OMcUswVXdmzppUNxqFK0Lju2WOVeRrp0cJrnODYsv6KPQ KVmJWiZTHwxzanawKIGJXEICoJodgsJvtUmNBDWuE5uW1YIyzhX+XAyQdKOrj5T+ju9Pb7TbmQM YOPxi7Jkkks+wCWMUcg+i4/LF8jsZk5HQzO74uw9Vry3hzx5yFc7aUewEq/iME50JYirSPooBXV Q= X-Gm-Gg: ASbGnctTZcqi9iTqkrzxCgWFkj7XSVF94bQX94Sh4OzMnOQRiEaU9FF9Qz+gcLNxVT2 5wLU9XT1RxmPjLg+GQCDqhZZO821yn59G+8VfCllEEx7LghTB70prJMMYNrr11U6TNsekN+px1/ qY9+DpzBtAJ0YHJs5jE7KfMSMsgtuGZp6YilUA17bhcD/L5gRwU4YstbVzyJxsKlmZV7t5yqe// hLeSjT3zo6qIaR3Op2s6ZWVZ1vwYAEk8O1ya3fXMnXq9qezH9W0VeMH4PRkoYgkMv10JIR8lfEE FGnrZb2b9UFsN4MhJQk9wek+nUIHuju5CPaS7O4Hvc6lxK7qk3fnO03fp537FBjruoEuYLuNpbn JYglqVosb6X6zwMzt/0nMtxnlgl3usA3QrRjCs7Gc X-Received: by 2002:a17:90b:4d84:b0:340:7b2e:64cc with SMTP id 98e67ed59e1d1-34947dbdb27mr7161693a91.15.1764943899449; Fri, 05 Dec 2025 06:11:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvIgH31sFc0fv/66qnhnm47zlrTrtPCxOOCtTotJgwqisCeo7VlZObp+bX3VPQSVYZkC+CVQ== X-Received: by 2002:a17:90b:4d84:b0:340:7b2e:64cc with SMTP id 98e67ed59e1d1-34947dbdb27mr7161643a91.15.1764943898915; Fri, 05 Dec 2025 06:11:38 -0800 (PST) Received: from [192.168.29.116] ([49.37.148.233]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34912d27040sm4502133a91.5.2025.12.05.06.11.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Dec 2025 06:11:38 -0800 (PST) Message-ID: Date: Fri, 5 Dec 2025 19:41:32 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tee: fix tee_ioctl_object_invoke_arg padding To: Arnd Bergmann , Jens Wiklander , Arnd Bergmann Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Amirreza Zarrabi , Sumit Garg , Sumit Garg , Alexandre Ghiti , Etienne Carriere , Randy Dunlap , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org References: <20251204101730.1036671-1-arnd@kernel.org> <45b5f14b-3746-4b05-a4b4-dc9f88e89e52@oss.qualcomm.com> <9e44024d-a649-49d6-825f-97f2a11e1691@app.fastmail.com> Content-Language: en-US From: Harshal Dev In-Reply-To: <9e44024d-a649-49d6-825f-97f2a11e1691@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=DOSCIiNb c=1 sm=1 tr=0 ts=6932e81c cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=v+kbWGyw1T97G6+vs1uYIQ==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=-jCBhvvmAAAA:20 a=VwQbUJbxAAAA:8 a=u8VM9LE-TGAWi8YemUAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 a=bA3UWDv6hWIuX7UZL3qL:22 X-Proofpoint-ORIG-GUID: dVc9bil4dQ0eASoqEjBDZgXE_OqU44BK X-Proofpoint-GUID: dVc9bil4dQ0eASoqEjBDZgXE_OqU44BK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjA1MDEwMiBTYWx0ZWRfX8CuHXyxMnsSq fm2+fhIaPELlhuXbgr6NkTpKq8136B0+f2NdKWhjcjpW3Izcw+FJeClq6RUAu8Pmbgik/JYwbIy nm/nOMMrpKJ+zpyCsHj/h4MfKXll8K+h9q6rIG+U7Eg8z4mWcNP7wZbqqHqbeJyB6uOVIBApj89 /jUyyMpLtz2f1NfPr4u5iKGxbpeCMGqtmlIBjT/d6qnkqUkxRXlxmwun2725BhMyf8GOvfOf8oQ x4iKDACrS06J7VnbO8xUolpvZTPMTixvsZur+BTyZWcbqCfOhceBh074TDVt+xcVcPagJRYbP1F 0qlDmrl+mWlEdoo8CNkuhSMc1icH1DyToVh7AqLgeDeIyMVDah8rCqt4JCzB8REmi2erj83YiHu Nm2MMlNnTk9atmwmGmdkHmqxosF1Bw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-05_05,2025-12-04_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 spamscore=0 phishscore=0 impostorscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512050102 On 12/5/2025 7:26 PM, Arnd Bergmann wrote: > On Fri, Dec 5, 2025, at 14:45, Harshal Dev wrote: >> On 12/4/2025 6:57 PM, Jens Wiklander wrote: >>> On Thu, Dec 4, 2025 at 11:17 AM Arnd Bergmann wrote: >>> >> The only user-space client which is currently using this ABI (as per >> our knowledge) >> is the libqcomtee library: >> https://github.com/quic/quic-teec/blob/main/libqcomtee/src/linux/tee.h#L432 >> >> If I understand Arnd's concern correctly, if a compiler used to build >> the user-space >> client skips the padding for tee_ioctl_object_invoke_arg, it could lead >> to issues. >> >> Let's wait for Amir's view here as well, however I do think the >> explicit padding would >> benefit here. >> > > The problem is much narrower: as the amount of padding is determined > by the architecture specific ABI, kernel and userspace on the same > architecture always agree, and specifically 32-bit Arm userspace > and 64-bit Arm userspace (aarch64) also have the same rules, so there > is no problem on Qualcomm's platforms even with compat 32-bit userspace. > > The only actual ABI problem would happen on 32-bit x86 (i386) > userspace running on a 64-bit x86 kernel, since i386-linux compilers > have different alignment rules from most other architectures. > Well, as Jens pointed out, the TEE_IOC_OBJECT_INVOKE ABI which supports object-based IPC currently has no back-end drivers that attempt to communicate with a TEE running on x86 and implementing their end of the object-IPC protocol in the firmware. So this obviously won't be an immediate issue. But as you pointed out, the issue would pop up if someone on x86 decides to implement it at some point in the far away future. I do not see any harm this patch would do for our existing implementation, we'll just update our user-space library ABI in-line with this. Thanks, Harshal > Arnd