From nobody Fri Dec 19 17:49:39 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DAEA633A71D for ; Thu, 4 Dec 2025 10:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764843456; cv=none; b=jygdOxW4ty4Reo0uES2ZuLXb0gBguGLD74bCO2SJ+vq/jX341GuaCqzodRVG60KLbVDZXoVPMtcOAugaIoIZIY9mpp8Q73fHdIN8/Y5jMeTlHiVVX8+XOaruS7637UqNCug+LxbF03yLS+FT3wIaKwIf1HyZ8VmJgHY0NW+9c9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764843456; c=relaxed/simple; bh=v52SFDURowFRdMULRhG8kjrdaOCOeP9fHkUhxwRA804=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IEl6bHdjpR5Bi1VXdtxOk8x+5NDEk2c0PKnj28IsPeVebtDBXbgRV6dRpdwAF+en5sgrO28DBqRFIkgQnP3Ker2xQxUdWjZnfLo4yRuw0+fkIbMYswDdgMdDq8min0/JGr/Br1olnk34MCwwZUiy/agT88eajAs/PssF8L2d8M8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IHZfTd85; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IHZfTd85" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52E64C4CEFB; Thu, 4 Dec 2025 10:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764843456; bh=v52SFDURowFRdMULRhG8kjrdaOCOeP9fHkUhxwRA804=; h=From:To:Cc:Subject:Date:From; b=IHZfTd85ChaInOyNphBu+x+Ie9l0i63IWSsB8NINZT8i901DNyfDn1fPw7Ykfn+VA sHai/AQaHrGAlMpTzFhmG0B3n8e1kmbXWPx1LdQp/d0JnL8hspJ6KhwcWCr/eX6O9K bOCNJuuOWdGo5TgQJO2FduEBR18CgIDmgbFm0t9VQqhTfUfRFe2kJkqSfAfXkdhqgW YVapBWjRPJviIQPdZ9xykW/r99F6hC4OBX5jtyiHnv1sWhvxxYqdJaBI2KSAD5CT23 52N1rP+MCLFoD48keb0UB31Cy8Bv3vWqpOb/k2eJV9JTKk2ZTg5TTzkEZMLAf8r8KF WWdMkF2GYysrg== From: Arnd Bergmann To: Jens Wiklander , Paul Walmsley , Palmer Dabbelt , Albert Ou , Amirreza Zarrabi , Sumit Garg Cc: 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 Subject: [PATCH] tee: fix tee_ioctl_object_invoke_arg padding Date: Thu, 4 Dec 2025 11:17:23 +0100 Message-Id: <20251204101730.1036671-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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' [-Werro= r=3Dpadded] 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 Reviewed-by: Jens Wiklander Reviewed-by: Sumit Garg Tested-by: Harshal Dev --- 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. --- 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[]; }; --=20 2.39.5