diff --git a/0362-ieee1275-ofnet-Fix-grub_malloc-removed-after-added-s.patch b/0362-ieee1275-ofnet-Fix-grub_malloc-removed-after-added-s.patch new file mode 100644 index 0000000..92da026 --- /dev/null +++ b/0362-ieee1275-ofnet-Fix-grub_malloc-removed-after-added-s.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nicolas Frayer +Date: Wed, 19 Mar 2025 17:39:41 +0100 +Subject: [PATCH] ieee1275/ofnet: Fix grub_malloc() removed after added safe + math functions + +grub_malloc() has been inadvertently removed from the ieee1275/ofnet +code after it has been modified to use safe match function. + +Fixes: 4beeff8a (net: Use safe math macros to prevent overflows) + +Tested-by: Marta Lewandowska +Reviewed-by: Daniel Kiper +Signed-off-by: Nicolas Frayer +--- + grub-core/net/drivers/ieee1275/ofnet.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c +index 3e1b9094e2ab..37bc82467f60 100644 +--- a/grub-core/net/drivers/ieee1275/ofnet.c ++++ b/grub-core/net/drivers/ieee1275/ofnet.c +@@ -463,6 +463,9 @@ search_net_devices (struct grub_ieee1275_devalias *alias) + return 0; + } + } ++ ++ ofdata->path = grub_malloc(sz); ++ + if (!ofdata->path) + { + grub_print_error (); diff --git a/grub.patches b/grub.patches index 2ca6a9b..c18280a 100644 --- a/grub.patches +++ b/grub.patches @@ -358,3 +358,4 @@ Patch0358: 0358-loader-i386-linux-Cast-left-shift-to-grub_uint32_t.patch Patch0359: 0359-loader-i386-bsd-Use-safe-math-to-avoid-underflow.patch Patch0360: 0360-fs-ext2-Rework-out-of-bounds-read-for-inline-and-ext.patch Patch0361: 0361-powerpc-increase-MIN-RMA-size-for-CAS-negotiation.patch +Patch0362: 0362-ieee1275-ofnet-Fix-grub_malloc-removed-after-added-s.patch diff --git a/grub2.spec b/grub2.spec index 3f0d001..101a05c 100644 --- a/grub2.spec +++ b/grub2.spec @@ -17,7 +17,7 @@ Name: grub2 Epoch: 1 Version: 2.12 -Release: 13%{?dist}.alma.1 +Release: 14%{?dist}.alma.1 Summary: Bootloader with support for Linux, Multiboot and more License: GPL-3.0-or-later URL: http://www.gnu.org/software/grub/ @@ -574,9 +574,13 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog -* Wed Mar 19 2025 Eduard Abdullin - 1:2.12-13.alma.1 +* Wed Mar 26 2025 Eduard Abdullin - 1:2.12-14.alma.1 - Debrand for AlmaLinux +* Tue Mar 25 2025 Nicolas Frayer 2.12-14 +- ieee1275/ofnet: Fix grub_malloc() removed after added safe +- Related: #RHEL-80073 + * Tue Mar 18 2025 Nicolas Frayer 2.12-13 - powerpc: increase MIN RMA size for CAS negotiation - Resolves: #RHEL-76429