From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 486EEEDEC1E for ; Wed, 4 Mar 2026 07:31:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9B74B83D8A; Wed, 4 Mar 2026 08:31:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 19F9383F61; Wed, 4 Mar 2026 08:31:49 +0100 (CET) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DDF72838BB for ; Wed, 4 Mar 2026 08:31:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sha@pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vxghu-0003C2-Ev; Wed, 04 Mar 2026 08:31:46 +0100 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxghs-003fxA-2P; Wed, 04 Mar 2026 08:31:46 +0100 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1vxghu-0000000GKdZ-06sU; Wed, 04 Mar 2026 08:31:46 +0100 Date: Wed, 4 Mar 2026 08:31:46 +0100 From: Sascha Hauer To: Tom Rini Cc: u-boot@lists.denx.de Subject: Re: [PATCH] FIT: Address Secure Boot Bypass for Signed FIT Images Message-ID: References: <20260302220937.3682128-1-trini@konsulko.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260302220937.3682128-1-trini@konsulko.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: u-boot@lists.denx.de X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi Tom, On Mon, Mar 02, 2026 at 04:09:37PM -0600, Tom Rini wrote: > There is a flaw in how U-Boot verifies and generates signatures for FIT > images. To prevent mix and match style attacks, it is recommended to > use signed configurations. How this is supposed to work is documented in > doc/usage/fit/signature.rst. > > Crucially, the `hashed-nodes` property of the `signature` node contains > which nodes of the FIT device tree were hashed as part of the signature > and should be verified. However, this property itself is not part of the > hash and can therefore be modified by an attacker. Furthermore, the > signature only contains the name of each node and not the path in the > device tree to the node. > > This patch reworks the code to address this specific oversight. As this breaks compatibility between old U-Boot and new FIT images and the other way round it would be good to introduce a version field to FIT images. With that at least newer U-Boot versions could print a more meaningful error message than just "image verification failed" which gives no clue what had actually happened. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |