Strip correctly BLS files with conf extension

Resolves: #RHEL-112099

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
This commit is contained in:
Leo Sandoval 2025-09-03 12:02:26 -06:00
parent 85c3021108
commit 53468617e9
3 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Leo Sandoval <lsandova@redhat.com>
Date: Wed, 3 Sep 2025 11:51:38 -0600
Subject: [PATCH] Strip correctly BLS files with conf extension
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
---
grub-core/commands/blscfg.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index 795a9f9f17..5e2302c4e8 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -417,12 +417,14 @@ static int bls_cmp(const void *p0, const void *p1, void *state)
id1 = grub_strdup(e1->filename);
l = grub_strlen(id0);
- if (l > 5 && grub_strcmp(id0 + l - 5, ".conf"))
- id0[l-5] = '\0';
+ if (l > 5)
+ if (!grub_strcmp(id0 + l - 5, ".conf"))
+ id0[l-5] = '\0';
l = grub_strlen(id1);
- if (l > 5 && grub_strcmp(id1 + l - 5, ".conf"))
- id1[l-5] = '\0';
+ if (l > 5)
+ if(!grub_strcmp(id1 + l - 5, ".conf"))
+ id1[l-5] = '\0';
r = split_cmp(id0, id1, 1);

View File

@ -674,3 +674,4 @@ Patch0674: 0674-fs-xfs-Add-large-extent-counters-incompat-feature-su.patch
Patch0675: 0675-fs-xfs-Handle-non-continuous-data-blocks-in-director.patch
Patch0676: 0676-fs-xfs-fix-large-extent-counters-incompat-feature-su.patch
Patch0677: 0677-fs-ext2-Rework-out-of-bounds-read-for-inline-and-ext.patch
Patch0678: 0678-Strip-correctly-BLS-files-with-conf-extension.patch

View File

@ -7,7 +7,7 @@
Name: grub2
Epoch: 1
Version: 2.02
Release: 167%{?dist}
Release: 168%{?dist}
Summary: Bootloader with support for Linux, Multiboot and more
Group: System Environment/Base
License: GPLv3+
@ -526,6 +526,10 @@ fi
%endif
%changelog
* Wed Sep 3 2025 Leo Sandoval <lsandova@redhat.com> - 2.02-168
- Strip correctly BLS files with conf extension
- Resolves: #RHEL-112099
* Thu Apr 24 2025 Leo Sandoval <lsandova@redhat.com> - 2.02-167
- 99-grub-mkconfig.install: fix condition allowing correct checks if GRUB_ENABLE_BLSCFG is not present
- Resolves: #RHEL-80168