From 68ca17813b00a0f95f1c17202cea6e384b0b9899 Mon Sep 17 00:00:00 2001 From: lzq11122 Date: Wed, 30 Jul 2025 15:00:27 +0800 Subject: [PATCH] fix-CVE-2025-5244 Signed-off-by: lzq11122 --- 1000-fix-CVE-2025-5244.patch | 26 ++++++++++++++++++++++++++ binutils.spec | 8 +++++++- test.patch | 14 ++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 1000-fix-CVE-2025-5244.patch create mode 100644 test.patch diff --git a/1000-fix-CVE-2025-5244.patch b/1000-fix-CVE-2025-5244.patch new file mode 100644 index 0000000..af556a5 --- /dev/null +++ b/1000-fix-CVE-2025-5244.patch @@ -0,0 +1,26 @@ +From 598c64968ad4a698b2969869d9ecd712bf3e7455 Mon Sep 17 00:00:00 2001 +From: lzq11122 +Date: Wed, 30 Jul 2025 14:46:23 +0800 +Subject: [PATCH 1/1] fix-CVE-2025-5244 + +--- + bfd/elflink.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/bfd/elflink.c b/bfd/elflink.c +index 19dc853a..b91408a2 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -14099,7 +14099,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) + if (o->flags & SEC_GROUP) + { + asection *first = elf_next_in_group (o); +- o->gc_mark = first->gc_mark; ++ if (first != NULL) ++ o->gc_mark = first->gc_mark; + } + + if (o->gc_mark) +-- +2.43.5 + diff --git a/binutils.spec b/binutils.spec index fdec0af..0978364 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,4 +1,4 @@ -%define anolis_release 6 +%define anolis_release 9 # Determine if this is a native build or a cross build. # # For a cross build add --define "binutils_target " to the command @@ -356,6 +356,9 @@ Patch0039: 0039-binutils-multilib.am.patch # https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e0323071916878e0634a6e24d8250e4faff67e88 Patch0040: 0040-fix-CVE-2024-53589.patch +# From https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=d1458933830456e54223d9fc61f0d9b3a19256f5;hp=6fe4e5bd10b996428a557e036c07c5839a8e0a49 +Patch0044: 1000-fix-CVE-2025-5244.patch + # Purpose: Suppress the x86 linker's p_align-1 tests due to kernel bug on CentOS-10 # Lifetime: TEMPORARY Patch0099: 0099-binutils-suppress-ld-align-tests.patch @@ -1131,6 +1134,9 @@ exit 0 %doc README ChangeLog MAINTAINERS README-maintainer-mode %changelog +* Wed Jul 30 2025 lzq11122 - 2.41-9 +- Add patch to fix CVE-2025-5244 + * Tue May 27 2025 mgb01105731 - 2.41-6 - Add patch to fix CVE-2024-53589 diff --git a/test.patch b/test.patch new file mode 100644 index 0000000..ff3bcc7 --- /dev/null +++ b/test.patch @@ -0,0 +1,14 @@ +diff --git a/bfd/elflink.c b/bfd/elflink.c +index a76e8e38da728b41c47dfe89e1b97cf99a7bdb7b..549b7b7dd92ab94c2027b37aca0acc1f45de8428 100644 (file) +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -14408,7 +14408,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) + if (o->flags & SEC_GROUP) + { + asection *first = elf_next_in_group (o); +- o->gc_mark = first->gc_mark; ++ if (first != NULL) ++ o->gc_mark = first->gc_mark; + } + + if (o->gc_mark) -- Gitee