From 1105c60ec5add7d023566fa1afb2320267463e82 Mon Sep 17 00:00:00 2001 From: sa-buc Date: Mon, 20 Oct 2025 17:48:40 +0800 Subject: [PATCH] fix cve --- binutils.spec | 8 ++++- fix-CVE-2024-57360.patch | 71 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 fix-CVE-2024-57360.patch diff --git a/binutils.spec b/binutils.spec index cc8f4a5..c954697 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,4 +1,4 @@ -%define anolis_release 12 +%define anolis_release 13 # Determine if this is a native build or a cross build. # # For a cross build add --define "binutils_target " to the command @@ -378,6 +378,9 @@ Patch0046: 0046-Support-x86-Zhaoxin-GMI-PadLock.patch # https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=baac6c221e9d69335bf41366a1c7d87d8ab2f893 Patch0047: fix-CVE-2025-0840.patch +# https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=5f8987d3999edb26e757115fe87be55787d510b9 +Patch0048: fix-CVE-2024-57360.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 @@ -1157,6 +1160,9 @@ exit 0 %doc README ChangeLog MAINTAINERS README-maintainer-mode %changelog +* Mon Oct 20 2025 zhoujiajia111 - 2.41-13 +- Add patch to fix CVE-2024-57360 + * Tue Aug 26 2025 mgb01105731 - 2.41-12 - Add patch to fix CVE-2025-0840 diff --git a/fix-CVE-2024-57360.patch b/fix-CVE-2024-57360.patch new file mode 100644 index 0000000..b557147 --- /dev/null +++ b/fix-CVE-2024-57360.patch @@ -0,0 +1,71 @@ +From 5f8987d3999edb26e757115fe87be55787d510b9 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Tue, 17 Dec 2024 09:18:57 +0000 +Subject: [PATCH] nm: Avoid potential segmentation fault when displaying + symbols without version info. + +PR 32467 +--- + binutils/nm.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +diff --git a/binutils/nm.c b/binutils/nm.c +index faf27c59b4d..0ba7604d34f 100644 +--- a/binutils/nm.c ++++ b/binutils/nm.c +@@ -682,7 +682,7 @@ print_symname (const char *form, struct extended_symbol_info *info, + const char *name, bfd *abfd) + { + char *alloc = NULL; +- char *atver = NULL; ++ char *atname = NULL; + + if (name == NULL) + name = info->sinfo->name; +@@ -690,9 +690,19 @@ print_symname (const char *form, struct extended_symbol_info *info, + if (!with_symbol_versions + && bfd_get_flavour (abfd) == bfd_target_elf_flavour) + { +- atver = strchr (name, '@'); ++ char *atver = strchr (name, '@'); ++ + if (atver) +- *atver = 0; ++ { ++ /* PR 32467 - Corrupt binaries might include an @ character in a ++ symbol name. Since non-versioned symbol names can be in ++ read-only memory (via memory mapping of a file's contents) we ++ cannot just replace the @ character with a NUL. Instead we ++ create a truncated copy of the name. */ ++ atname = xstrdup (name); ++ atname [atver - name] = 0; ++ name = atname; ++ } + } + + if (do_demangle && *name) +@@ -703,9 +713,7 @@ print_symname (const char *form, struct extended_symbol_info *info, + } + + if (unicode_display != unicode_default) +- { +- name = convert_utf8 (name); +- } ++ name = convert_utf8 (name); + + if (info != NULL && info->elfinfo && with_symbol_versions) + { +@@ -726,8 +734,8 @@ print_symname (const char *form, struct extended_symbol_info *info, + } + } + printf (form, name); +- if (atver) +- *atver = '@'; ++ ++ free (atname); + free (alloc); + } + +-- +2.43.7 + -- Gitee