From 2b708750bd412650d7a7a32dd93d4bb044fc737a Mon Sep 17 00:00:00 2001 From: Qiumiao Zhang Date: Wed, 31 May 2023 15:23:38 +0800 Subject: [PATCH] skip verification when just opening the grub.cfg without loading it Signed-off-by: Qiumiao Zhang --- grub.patches | 3 +- grub2.spec | 8 ++++- ...rification-when-not-loading-grub.cfg.patch | 29 +++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 skip-verification-when-not-loading-grub.cfg.patch diff --git a/grub.patches b/grub.patches index 7240638..85eae75 100644 --- a/grub.patches +++ b/grub.patches @@ -446,4 +446,5 @@ Patch0445: backport-fs-iso9660-Prevent-skipping-CE-or-ST-at-start-of-continuatio Patch0446: backport-fs-iso9660-Incorrect-check-for-entry-boundary.patch Patch0447: backport-fs-iso9660-Avoid-reading-past-the-entry-boundary.patch Patch0448: backport-net-bootp-Fix-unchecked-return-value.patch -Patch0449: backport-osdep-linux-hostdisk-Modify-sector-by-sysfs-as-disk-sector.patch \ No newline at end of file +Patch0449: backport-osdep-linux-hostdisk-Modify-sector-by-sysfs-as-disk-sector.patch +Patch0450: skip-verification-when-not-loading-grub.cfg.patch diff --git a/grub2.spec b/grub2.spec index 5e7fcea..0084a43 100644 --- a/grub2.spec +++ b/grub2.spec @@ -8,7 +8,7 @@ Name: grub2 Epoch: 1 Version: 2.04 -Release: 32 +Release: 33 Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -442,6 +442,12 @@ rm -r /boot/grub2.tmp/ || : %{_datadir}/man/man* %changelog +* Wed May 31 2023 zhangqiumiao - 1:2.04-33 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:skip verification when not loading grub.cfg + * Sun Apr 16 2023 zhangqiumiao - 1:2.04-32 - Type:bugfix - CVE:NA diff --git a/skip-verification-when-not-loading-grub.cfg.patch b/skip-verification-when-not-loading-grub.cfg.patch new file mode 100644 index 0000000..09b62b6 --- /dev/null +++ b/skip-verification-when-not-loading-grub.cfg.patch @@ -0,0 +1,29 @@ +From c8b6446348a445a51024d04b2e8e5b417c3a1f73 Mon Sep 17 00:00:00 2001 +From: Qiumiao Zhang +Date: Wed, 31 May 2023 15:13:07 +0800 +Subject: [PATCH] skip verification when not loading grub.cfg + +Skip verification when just opening the grub.cfg without loading it. +There is no need to verify grub.cfg twice when tpcm is enabled. + +Signed-off-by: Qiumiao Zhang +--- + grub-core/normal/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index f7ee912..7a2dd3b 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -368,7 +368,7 @@ grub_try_normal (const char *variable) + if (config) + { + grub_file_t file; +- file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG); ++ file = grub_file_open (config, GRUB_FILE_TYPE_SKIP_SIGNATURE); + if (file) + { + grub_file_close (file); +-- +2.27.0 +