From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 25 Nov 2026 18:29:59 +0100 Received: from mx1.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::107]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xWGog-003Ben-1P for lore@lore.pengutronix.de; Wed, 25 Nov 2026 18:29:59 +0100 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPS id D4AF7201941 for ; Wed, 25 Nov 2026 18:29:54 +0100 (CET) Authentication-Results: mx1.white.stw.pengutronix.de; dkim=pass header.d=lists.infradead.org header.s=bombadil.20210309 header.b=Lp7aeh+E; spf=pass (mx1.white.stw.pengutronix.de: domain of "barebox-bounces+lore=pengutronix.de@lists.infradead.org" designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="barebox-bounces+lore=pengutronix.de@lists.infradead.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=barebox.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1795627794; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=puTc+95UrnxNAPDPtjeTaJCO4OtWz+oNz/o+KytHtNw=; b=LgF5lsAY93NhLBOh6sxXM2YxINKBYMtl1uGg4BubknDjvmnvJxbZPnk1HQV+3noWIOwyGH 9BGMm3TZG5utY/1SyDKNbCw0u2Tw3nPufQZBWWRdnRjTzBCyNatc4KlI8gXhV3ZZPvHe7Z hrKdssowZ3dKYJk9PTQvJ+kG9Y2MCGQIz37Lh5FWBJZ3uo3uxQhRmNOxqn69cc0OZCAI0w 5hY6srXNSMN/4d3ePc+fz5jpspgv7PyN+Loo9pirEva/I9vekKqzO9Me+yligKy/dUCxhc 7fZzb7FvjSH24BWBacyBrEVvORAXfNXkCcAKG1uFbWOYkrNuPAgDLR1+pAh/AA== ARC-Authentication-Results: i=1; mx1.white.stw.pengutronix.de; dkim=pass header.d=lists.infradead.org header.s=bombadil.20210309 header.b=Lp7aeh+E; spf=pass (mx1.white.stw.pengutronix.de: domain of "barebox-bounces+lore=pengutronix.de@lists.infradead.org" designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="barebox-bounces+lore=pengutronix.de@lists.infradead.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=barebox.org (policy=none) ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1795627794; a=rsa-sha256; cv=none; b=KAZD2Dy+LGOE6RjbgOtGuE+L6MV/R/ubj5WtY9W9nbnyxLF+SvzlO2y+pxbuXA0RVfcUR1 obPtzqsyeVKo2FqMEOvwB5JgsbAqKVMzKSLAWej4hrWShVlnehMt5QGA60tWKGtlteNdp6 eEj6DYiHxCE6Q16dOqxoZlQCr3xiF3Sx2aEfHZj3CtnayFKe6MT8Q7IL8lraI9qXeCdqkk Z65UROK3CQsAASqgtMlaO9WsJ20ITKDi+cgyeHhsP9F2M8iqyWN6y/NxxBrH+nud3rO15O lDqcuPZEK3DGiS6vZ2eAbBhj5lhWolIANsgA/hSfv5+IE3lLwE8c2e1fZ9973A== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=puTc+95UrnxNAPDPtjeTaJCO4OtWz+oNz/o+KytHtNw=; b=Lp7aeh+E9Q4XmFs/KkzCZ0jjyf S0JconcIiVw1GLB3tETsCBFW3QO2VTL7TIY/toHjPNAcwWiaDHbbvcS+jdc0P1ikUuKxNLHZrlJ/z dJpgTUq7kddMsMP+Uzt5xo/SpyhpE9P1JnVx7DRWCqoqDWkG+5wV/HqzilKCyX+eTXuCFEb4bpb2+ pwubny1Lh3tG2DrOvB6csczO+5UOII4xSzqmfMRyoj4hlFU4uLpn57FpBnhKvFurA0TwGQJ6RlGhl o97Z6buiRxpyh7BXquRNvmI5eo+qvr0jaWB3hFLk6K18da7la8khu4PkoNrE9+x2LRUuIKeC2Rwor X3r3bvaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWGnB-0000000Ajxr-3WpH; Wed, 25 Nov 2026 17:28:25 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWGn5-0000000AjwR-1Ful for barebox@lists.infradead.org; Wed, 25 Nov 2026 17:28:24 +0000 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=geraet.guest.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1xWGn0-0000rz-Am; Wed, 25 Nov 2026 18:28:14 +0100 From: Ahmad Fatoum To: barebox@lists.infradead.org Cc: Ahmad Fatoum Subject: [PATCH] ARM: bootm-fip: don't dereference a missing HW_CONFIG Date: Wed, 25 Nov 2026 18:28:11 +0100 Message-ID: <20261125172813.1511714-1-a.fatoum@barebox.org> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: a.fatoum@barebox.org X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261125_092821_586001_D573489D X-CRM114-Status: GOOD ( 10.57 ) X-Spam-Score: -1.0 (-) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: A FIP without a HW_CONFIG entry has no loadable for it, but the jump to BL33 dereferences its start address unconditionally. The STM32MP FIPs always have one. Let's pass 0 when there's none, as the verbose print above already allows for. Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a0a:edc0:2:b01:1d:0:0:104 listed in] [list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.9 DMARC_NONE DMARC none policy X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-Stat-Signature: e9gdzpq5mz7ejxidxrj3psttnessirat X-Spamd-Result: default: False [-6.11 / 15.00]; BAYES_HAM(-3.00)[99.99%]; DWL_DNSWL_MED(-2.00)[infradead.org:dkim]; KNOWN_LIST_ID(-1.00)[barebox.lists.infradead.org]; MID_CONTAINS_FROM(1.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_MISSING_CHARSET(0.50)[]; RCVD_IN_DNSWL_MED(-0.40)[2a0a:edc0:0:900:1d::77:received,2607:7c80:54:3::133:from]; MAILLIST(-0.20)[mailman]; R_SPF_ALLOW(-0.20)[+mx:c]; R_DKIM_ALLOW(-0.20)[lists.infradead.org:s=bombadil.20210309]; RCVD_IN_DNSWL_LOW(-0.10)[2a0a:edc0:2:b01:1d::104:received]; DMARC_POLICY_SOFTFAIL(0.10)[barebox.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; RECEIVED_HELO_LOCALHOST(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_SIGNED(0.00)[pengutronix.de:s=20260414:i=1]; NEURAL_HAM(-0.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[lists.infradead.org:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:7247, ipnet:2607:7c80:54::/48, country:US]; FROM_NEQ_ENVFROM(0.00)[a.fatoum@barebox.org,barebox-bounces@lists.infradead.org]; RCVD_TLS_LAST(0.00)[]; TAGGED_FROM(0.00)[lore=pengutronix.de]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Action: no action X-Rspamd-Server: mx1 X-Rspamd-Queue-Id: D4AF7201941 A FIP without a HW_CONFIG entry has no loadable for it, but the jump to BL33 dereferences its start address unconditionally. The STM32MP FIPs always have one. Let's pass 0 when there's none, as the verbose print above already allows for. Fixes: c33636a0f165 ("ARM: add support for chainloading barebox inside FIP images") Signed-off-by: Ahmad Fatoum --- arch/arm/cpu/bootm-fip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/cpu/bootm-fip.c b/arch/arm/cpu/bootm-fip.c index a4da4c538abe..beeae09f4066 100644 --- a/arch/arm/cpu/bootm-fip.c +++ b/arch/arm/cpu/bootm-fip.c @@ -194,6 +194,7 @@ static int do_bootm_fip(struct image_data *data) struct fip_image_desc *loadables[IMAGE_COUNT] = {}; struct fip_image_desc *desc; struct fip_state *fip; + phys_addr_t hw_config = 0; int ret; if (!data->os_file) @@ -239,13 +240,16 @@ static int do_bootm_fip(struct image_data *data) goto out; } + if (loadables[IMAGE_HW_CONFIG]) + hw_config = desc_get_res(loadables[IMAGE_HW_CONFIG])->start; + shutdown_barebox(); /* We don't actually expect NT FW to be a Linux image, but * we want to use the Linux boot calling convention */ jump_to_linux((void *)desc_get_res(loadables[IMAGE_BL33])->start, - desc_get_res(loadables[IMAGE_HW_CONFIG])->start); + hw_config); ret = -EIO; out: -- 2.47.3