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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46A10CF5386 for ; Wed, 23 Oct 2024 13:09:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DC30C60657; Wed, 23 Oct 2024 13:09:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id G0ySWmch3rtu; Wed, 23 Oct 2024 13:09:34 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D1D3360675 Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id D1D3360675; Wed, 23 Oct 2024 13:09:33 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id CE9BE2072 for ; Wed, 23 Oct 2024 13:09:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BCB0360675 for ; Wed, 23 Oct 2024 13:09:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ZkVGZgRGNpU5 for ; Wed, 23 Oct 2024 13:09:30 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=217.70.183.194; helo=relay2-d.mail.gandi.net; envelope-from=peko@korsgaard.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 2A4B460657 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2A4B460657 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2A4B460657 for ; Wed, 23 Oct 2024 13:09:29 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0147740006; Wed, 23 Oct 2024 13:09:25 +0000 (UTC) Received: from peko by dell.be.48ers.dk with local (Exim 4.96) (envelope-from ) id 1t3b77-0043Ls-1d; Wed, 23 Oct 2024 15:09:25 +0200 From: Peter Korsgaard To: buildroot@buildroot.org Date: Wed, 23 Oct 2024 15:09:11 +0200 Message-Id: <20241023130912.966121-1-peter@korsgaard.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-GND-Sasl: peter@korsgaard.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Subject: [Buildroot] [PATCH-2024.02.x] package/bootgen: add patch to fix crash with -verify X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neal Frager Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The 2023.2 version forgets to populate the iHT structure before accessing it, leading to a segfault. Add a patch submitted upstream to fix that. Notice that this is fixed in the 2024.1 version as there ReadBinaryFile() now calls ReadHeaderTableDetails(): https://github.com/Xilinx/bootgen/commit/3a0f879c611d67072aad3461f1c72d1a284cd5fc#diff-404aa20e03f1035b725ac1ea6e64c28477bb65c1663da67f64ffdb1a60552cee Signed-off-by: Peter Korsgaard --- ...segmentation-fault-that-occurs-durin.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 package/bootgen/0001-verifyimage-Fix-segmentation-fault-that-occurs-durin.patch diff --git a/package/bootgen/0001-verifyimage-Fix-segmentation-fault-that-occurs-durin.patch b/package/bootgen/0001-verifyimage-Fix-segmentation-fault-that-occurs-durin.patch new file mode 100644 index 0000000000..096dbac27e --- /dev/null +++ b/package/bootgen/0001-verifyimage-Fix-segmentation-fault-that-occurs-durin.patch @@ -0,0 +1,50 @@ +From f7825edbd1c85380cfb5ef0cf2c16c910954f57c Mon Sep 17 00:00:00 2001 +From: Charlie Johnston +Date: Mon, 5 Aug 2024 13:07:25 -0700 +Subject: [PATCH] verifyimage: Fix segmentation fault that occurs during + verifyimage. + +In commit d02322b, the behavior of ReadBinaryFile was changed such +that it no longer populated iHT. This caused VerifyAuthentication +to access a null iHT value resulting a segmentation fault. + +This fix changes VerifyAuthentication to call ReadHeaderTableDetails +instead, where the old functionality of ReadBinaryFile now lives. + +Signed-off-by: Charlie Johnston +Signed-off-by: Peter Korsgaard +Upstream: https://github.com/Xilinx/bootgen/pull/36 +--- + verifyimage-versal.cpp | 2 +- + verifyimage-zynqmp.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/verifyimage-versal.cpp b/verifyimage-versal.cpp +index 5490663..5656e50 100755 +--- a/verifyimage-versal.cpp ++++ b/verifyimage-versal.cpp +@@ -34,7 +34,7 @@ + /*******************************************************************************/ + void VersalReadImage::VerifyAuthentication(bool verifyImageOption) + { +- ReadBinaryFile(); ++ ReadHeaderTableDetails(); + + if (iHT->headerAuthCertificateWordOffset != 0) + { +diff --git a/verifyimage-zynqmp.cpp b/verifyimage-zynqmp.cpp +index d4812e6..d73272c 100755 +--- a/verifyimage-zynqmp.cpp ++++ b/verifyimage-zynqmp.cpp +@@ -50,7 +50,7 @@ static void RearrangeEndianess(uint8_t *array, uint32_t size) + /*******************************************************************************/ + void ZynqMpReadImage::VerifyAuthentication(bool verifyImageOption) + { +- ReadBinaryFile(); ++ ReadHeaderTableDetails(); + + if (iHT->headerAuthCertificateWordOffset != 0) + { +-- +2.39.5 + -- 2.39.5 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot