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 B361923D7FF for ; Mon, 8 Dec 2025 05:24:25 +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=1765171467; cv=none; b=Pu0UQVeDxVuzdH28V5b38sMDXykWj5skIIuxU2/w22VDZmDb0Bdx3N0EpNXEfAGZXNtUO0d7A1sbOoBEoHQWkUIJFrlc62ZxbagbeU21Q5AjluTy58VZnNShLOaPDZmpgg7ckW0+Vv1+KonswHKDk0ovYwCfFcHZuV8nIYVqE9k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765171467; c=relaxed/simple; bh=Pfwcd94pZOYKxHffduYc3Ftt3S0iQDaj/oVfSuu8OHE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eQ3jeuYi3zDMakRWOhsd+oXDgNEm7Wt4FE02TVkYyH8YGbNzz0CgfUz66mBzAIyx8RUogUQFHMADThGAJxiJjP9U3m+/LcMK1AmPeuVW65CcPPw3gBS1kA49j/dRuCBHoegI4a11bKUY+oz7Q4G1/Lrp3Ye9GllR5PFHaX9gUXI= 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=ApOVx5ly; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=MBZXHOR7; 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="ApOVx5ly"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="MBZXHOR7" 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 5B7MsaGW3096344 for ; Mon, 8 Dec 2025 05:24:25 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= CTFDaI0X2upqE8C3ur4iiWVf3TE03Gdd/FG9zE6s/AM=; b=ApOVx5lyNdoxDrd8 Xi0d3GljU5ydMHmXVOdvIsNWuswRKmAi8ICo2Y0xNGnku/zlr9cRkD6grk0pdj1/ uQ4IYNWOFf8RpAlBDCLBdhzmVOvb2dzLBEJyEKwJ3D0zJq4AUqwods99QHu9recL bdd6g6KVILVvFDVQ4f/jysJzUcVjTDspzVMIcBGhukLDE4gauWHVFedSLWeTHpHg 80tVsBsZI6Jw087vT+6pa6PuORvs+6r0LRp6+7rlRl40fQj7ixOzsJoYpRTcD2L1 Cn8dzbMKh1WPFFaFFxPqMxQdo5jbP7+1Z84OUu7xaoPhFqRBagjxrsCIJU1y0kPo HLDJ1Q== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4avd8e3ms7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 08 Dec 2025 05:24:24 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-295592eb5dbso75487245ad.0 for ; Sun, 07 Dec 2025 21:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765171464; x=1765776264; 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=CTFDaI0X2upqE8C3ur4iiWVf3TE03Gdd/FG9zE6s/AM=; b=MBZXHOR7V/B+a02FMFcCmd+eO2O3TenY556LTKYaMdvgH8bFAQt0SblzjuwUxlonPs AAv6EVSI9WlTZlDLH+zvXo5Z2NuHgNut8nmjx9SFDHraWIsAPoSZhYE69agtoUTqFVQe j4wAwWBuc5ma7Vgd8b7LmcSpsizvKflC57CbKTEkLOl+oiF0/oDkXlqlkta5aZUo8zV5 GrXjS+SZAsCIbyawQP6e6l2yLgGWW2lHDfkhj86PC7q6GU3fdOwkaZnrBiIUE4bm5Qi1 g5p3UERzZIVgNMX4nCJqTHkBjjGjE5/tLkhe0ae2kspBuZnXjO8BxW2uobHCNEzWGEUg ip9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765171464; x=1765776264; 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=CTFDaI0X2upqE8C3ur4iiWVf3TE03Gdd/FG9zE6s/AM=; b=O5QGpcq6vqZ8Fse9+Bk8L8Y/q3kmGkDWd//MGvq2Yh5yjm++J0bdE12T2p3EM5UB/4 bnq+Cvzo6xIPwVic/M5YFqpLGxge5K4rJLjAPwM3RYgpqCT8jnbbzYFrQONl7ljPljb0 xONlYXdhpC93CA+OUqDEN73nuKsZEFbWa/OsBBjVmieQkDagrnKW4lmhVWv1ZEqHNUTf MlATYuKUVrwVAbgDtTLiL8nYIoye6IOnrhUjO5C4B3r0UDyUmkd9X8NbNaJXA1OjkScI stNr1ylJ0xoIb+FxjgZOt+df+As/UNrnI3Vn/sXxCJvwFlx9r9UkWHbOWII8qcw2STua xVLg== X-Forwarded-Encrypted: i=1; AJvYcCVCKEZ5KAPiblIweEWj9aL7B4Z7iXJ3hUTGaEutqIwaS3WDR+bNGWUf3KW6Wd382WHlJ3kq6hGRu3X71nI=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4dtuRYCP68vQVnbBXaXiXf8O9lQzr0z5P/7lr+v7O0ztJDD3T VH9/N1NrS0WQac3a3Za24p7t22V1DGyXXYizIkfBMYdaWw+Bl5PRXTjurqFvxM2Ch6SJHmlN4c+ j8By/2kN6AQ4af9iN8ocXaljxUt0iKJpVAItP8vdoXcncqfMIVyXAzCY5JyOvfTol+A== X-Gm-Gg: ASbGncvXlktLdtTDuk7nBaWC9wGerFWMwUqA33OtSsRPqadZnXoYClbDIqLhVNjNVN1 hzqBHdjePh/U69qav2bJVORBHcIC1ygCm7YBQc7HSVGOHRFic9dCL/IR2LhIbGWXU3IhVo8397g g0REPYykPpzMlWDjFswjwJVLgpSpiTzhClgEUzycuAvjhOyU7ZnJTxPPWZ1gZuwNKjqfkOYSqb1 7I6jpCGvhDIj/XbhLiUy4P9f1wtiDK9Tbzqr2apcPgTsm/HgB2lK7DthqCEc55Gr4SCpg0qBovo xABaaEaC7vR26gI79QV6CJIGeETdhXjFuB7vyw3nQJZJbYeC6u/na6pH1igwyVJ/AskosK3mFoC EQc8ByvElvLmToowuWTJ8RpzS/lbfepakusOgHIzw7RaFN0kvASGVZaoYzVzJJR7SvkuX3JiBTM SioRoI/xU= X-Received: by 2002:a17:902:f693:b0:248:ff5a:b768 with SMTP id d9443c01a7336-29df5571f2dmr58562615ad.10.1765171463885; Sun, 07 Dec 2025 21:24:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTwo90BTgSEMEr4il9ifC75dGqZTYMnmBFNNwzpfJCfnl95G5gnFXZV8agR/+7hCFVjz8BVw== X-Received: by 2002:a17:902:f693:b0:248:ff5a:b768 with SMTP id d9443c01a7336-29df5571f2dmr58562465ad.10.1765171463383; Sun, 07 Dec 2025 21:24:23 -0800 (PST) Received: from [192.168.0.74] (n1-41-240-65.bla22.nsw.optusnet.com.au. [1.41.240.65]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29daeaac16fsm109803545ad.87.2025.12.07.21.24.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Dec 2025 21:24:22 -0800 (PST) Message-ID: <0b061075-ab71-4ac1-93ec-438ddaaec903@oss.qualcomm.com> Date: Mon, 8 Dec 2025 16:24:17 +1100 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: Jens Wiklander , Arnd Bergmann Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Sumit Garg , Arnd Bergmann , 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> Content-Language: en-US From: Amirreza Zarrabi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjA4MDA0MyBTYWx0ZWRfX02tkAol4HKtE LC8524g3lpxBVH3fkoHsez0zLPuqy/T3dSnTRoHfk/E5zxNXUZg61/o3sc5wEmH5wlWMB1cAF41 mP1NotJaylAqtlk5djLPDjSRaVd6Ez1ehbY5jAsJwOxQis7S2kTX4m2PrMJeJDiPkkoL7YOFKSs P5HUreIqNN+WVi/JwTV8g3f4OvbZayZYtgkM2XSFJjzOUBB9L6CU2gSycRIbh5EPu53FLnkGfIu H3Qk77kerXBnA5f1Bq27kiKkoppzHK1sM9WVo4MwknKm0LeXWyNNIzxJRx4IP/pVzd3FHO5yBBX wo7WcF8HIQtSfNh2xEN4D7aIsJuWPPjCRaX5siFiOPw8xGa8JravVC4MXJmpIy6yn0Qpl0kpHzN V/QtUHUk6McPWYCG5I1GxWCbZMmCGw== X-Authority-Analysis: v=2.4 cv=BqaQAIX5 c=1 sm=1 tr=0 ts=69366108 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=hi51d+lTLNy/RbqRqnOomQ==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=xFIYUFTxM1JpX5VCbgAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: ldcA4nXO8I3DoB7_Qc-ohb-zcXZG1fne X-Proofpoint-ORIG-GUID: ldcA4nXO8I3DoB7_Qc-ohb-zcXZG1fne 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-06_02,2025-12-04_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 phishscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512080043 Hi, On 12/5/2025 12:27 AM, Jens Wiklander wrote: > Hi, > > On Thu, Dec 4, 2025 at 11:17 AM Arnd Bergmann wrote: >> >> From: Arnd Bergmann >> >> The tee_ioctl_object_invoke_arg structure has padding on some >> architectures but not on x86-32 and a few others: >> >> include/linux/tee.h:474:32: error: padding struct to align 'params' [-Werror=padded] >> >> I expect that all current users of this are on architectures that do >> have implicit padding here (arm64, arm, x86, riscv), so make the padding >> explicit in order to avoid surprises if this later gets used elsewhere. >> >> Fixes: d5b8b0fa1775 ("tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF") >> Signed-off-by: Arnd Bergmann >> --- >> The new interface showed up in 6.18, but I only came across this after >> that was released. Changing it now is technically an ABI change on >> architectures with unusual padding rules, so please consider carefully >> whether we want to do it this way or not. >> >> Working around the ABI differences without an ABI change is possible, >> but adds a lot of complexity for compat handling. > > This is currently only used by the recently introduced qcomtee backend > driver. So it's only used on a few arm64 Qualcomm platforms right now. > > I think we should take this patch, but let's hear what others think. > > Thanks, > Jens > I agree. We should take this patch. As noted, there are not many clients relying on it yet, so updating the userspace should be straightforward. Best Regards, Amir >> --- >> include/uapi/linux/tee.h | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h >> index cab5cadca8ef..5203977ed35d 100644 >> --- a/include/uapi/linux/tee.h >> +++ b/include/uapi/linux/tee.h >> @@ -470,6 +470,7 @@ struct tee_ioctl_object_invoke_arg { >> __u32 op; >> __u32 ret; >> __u32 num_params; >> + __u32 :32; >> /* num_params tells the actual number of element in params */ >> struct tee_ioctl_param params[]; >> }; >> -- >> 2.39.5 >>