Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gtVMM-0000xH-Es for mharc-grub-devel@gnu.org; Tue, 12 Feb 2019 05:32:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtVMG-0000tY-U8 for grub-devel@gnu.org; Tue, 12 Feb 2019 05:32:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtVMC-0004B2-Fl for grub-devel@gnu.org; Tue, 12 Feb 2019 05:32:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:52042 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtVMB-00042i-UQ for grub-devel@gnu.org; Tue, 12 Feb 2019 05:32:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0EA79B151; Tue, 12 Feb 2019 10:31:12 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Cc: leif.lindholm@linaro.org, Peter Jones , Paul Walmsley , David Abdurachmanov , atish.patra@wdc.com, schwab@suse.de, Michael Chang , Alistair Francis , Lukas Auer , "greentime @ andestech . com" , "rickchen36 @ gmail . com" , Bin Meng , Daniel Kiper Subject: [PATCH v6 11/11] fdt: Treat device tree file type like ACPI Date: Tue, 12 Feb 2019 11:31:08 +0100 Message-Id: <20190212103108.56963-12-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20190212103108.56963-1-agraf@suse.de> References: <20190212103108.56963-1-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Feb 2019 10:32:11 -0000 We now have signature check logic in grub which allows us to treat files differently depending on their file type. Treat a loaded device tree like an overlayed ACPI table. Both describe hardware, so I suppose their threat level is the same. Signed-off-by: Alexander Graf Reviewed-by: Daniel Kiper --- v3 -> v4: - Rebase onto current git master --- grub-core/commands/efi/shim_lock.c | 1 + include/grub/file.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/commands/efi/shim_lock.c b/grub-core/commands/efi/shim_lock.c index 01246b0fc..83568cb2b 100644 --- a/grub-core/commands/efi/shim_lock.c +++ b/grub-core/commands/efi/shim_lock.c @@ -81,6 +81,7 @@ shim_lock_init (grub_file_t io, enum grub_file_type type, /* Fall through. */ case GRUB_FILE_TYPE_ACPI_TABLE: + case GRUB_FILE_TYPE_DEVICE_TREE_IMAGE: *flags = GRUB_VERIFY_FLAGS_DEFER_AUTH; return GRUB_ERR_NONE; diff --git a/include/grub/file.h b/include/grub/file.h index cbbd29465..31567483c 100644 --- a/include/grub/file.h +++ b/include/grub/file.h @@ -74,8 +74,6 @@ enum grub_file_type GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE, - GRUB_FILE_TYPE_DEVICE_TREE_IMAGE, - /* File holding signature. */ GRUB_FILE_TYPE_SIGNATURE, /* File holding public key to verify signature once. */ @@ -100,6 +98,8 @@ enum grub_file_type GRUB_FILE_TYPE_FILE_ID, /* File holding ACPI table. */ GRUB_FILE_TYPE_ACPI_TABLE, + /* File holding Device Tree. */ + GRUB_FILE_TYPE_DEVICE_TREE_IMAGE, /* File we intend show to user. */ GRUB_FILE_TYPE_CAT, GRUB_FILE_TYPE_HEXCAT, -- 2.12.3