Skip to content

Commit c0c6316

Browse files
authored
[Medium] Patch binutils for CVE-2025-5245 and CVE-2025-5244 (#13906)
1 parent ae3f157 commit c0c6316

7 files changed

Lines changed: 87 additions & 13 deletions

File tree

SPECS/binutils/CVE-2025-5244.patch

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 186b3fef5b6938267c1b997ac63108a2938316f7 Mon Sep 17 00:00:00 2001
2+
From: AkarshHCL <v-akarshc@microsoft.com>
3+
Date: Thu, 29 May 2025 05:52:21 +0000
4+
Subject: [PATCH] Address CVE-2025-5244
5+
6+
Upstream Patch reference: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d1458933830456e54223d9fc61f0d9b3a19256f5
7+
8+
---
9+
bfd/elflink.c | 3 ++-
10+
1 file changed, 2 insertions(+), 1 deletion(-)
11+
12+
diff --git a/bfd/elflink.c b/bfd/elflink.c
13+
index 30b32bf9..be2a2f53 100644
14+
--- a/bfd/elflink.c
15+
+++ b/bfd/elflink.c
16+
@@ -14120,7 +14120,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
17+
if (o->flags & SEC_GROUP)
18+
{
19+
asection *first = elf_next_in_group (o);
20+
- o->gc_mark = first->gc_mark;
21+
+ if (first != NULL)
22+
+ o->gc_mark = first->gc_mark;
23+
}
24+
25+
if (o->gc_mark)
26+
--
27+
2.45.2
28+

SPECS/binutils/CVE-2025-5245.patch

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 0337a44778cd8c29da76653f438b39f7ce674fd1 Mon Sep 17 00:00:00 2001
2+
From: AkarshHCL <v-akarshc@microsoft.com>
3+
Date: Wed, 28 May 2025 12:10:43 +0000
4+
Subject: [PATCH] Address CVE-2025-5245
5+
6+
Upstream Patch Reference: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a
7+
8+
---
9+
binutils/debug.c | 9 +++------
10+
1 file changed, 3 insertions(+), 6 deletions(-)
11+
12+
diff --git a/binutils/debug.c b/binutils/debug.c
13+
index bb26d914..59ba206e 100644
14+
--- a/binutils/debug.c
15+
+++ b/binutils/debug.c
16+
@@ -2554,9 +2554,6 @@ debug_write_type (struct debug_handle *info,
17+
case DEBUG_KIND_UNION_CLASS:
18+
return debug_write_class_type (info, fns, fhandle, type, tag);
19+
case DEBUG_KIND_ENUM:
20+
- if (type->u.kenum == NULL)
21+
- return (*fns->enum_type) (fhandle, tag, (const char **) NULL,
22+
- (bfd_signed_vma *) NULL);
23+
return (*fns->enum_type) (fhandle, tag, type->u.kenum->names,
24+
type->u.kenum->values);
25+
case DEBUG_KIND_POINTER:
26+
@@ -3097,9 +3094,9 @@ debug_type_samep (struct debug_handle *info, struct debug_type_s *t1,
27+
break;
28+
29+
case DEBUG_KIND_ENUM:
30+
- if (t1->u.kenum == NULL)
31+
- ret = t2->u.kenum == NULL;
32+
- else if (t2->u.kenum == NULL)
33+
+ if (t1->u.kenum->names == NULL)
34+
+ ret = t2->u.kenum->names == NULL;
35+
+ else if (t2->u.kenum->names == NULL)
36+
ret = false;
37+
else
38+
{
39+
--
40+
2.45.2
41+

SPECS/binutils/binutils.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Summary: Contains a linker, an assembler, and other tools
2222
Name: binutils
2323
Version: 2.41
24-
Release: 5%{?dist}
24+
Release: 6%{?dist}
2525
License: GPLv2+
2626
Vendor: Microsoft Corporation
2727
Distribution: Azure Linux
@@ -38,6 +38,8 @@ Patch4: CVE-2025-1181.patch
3838
Patch5: CVE-2025-1182.patch
3939
Patch6: CVE-2025-0840.patch
4040
Patch7: CVE-2025-1744.patch
41+
Patch8: CVE-2025-5245.patch
42+
Patch9: CVE-2025-5244.patch
4143
Provides: bundled(libiberty)
4244

4345
# Moving macro before the "SourceX" tags breaks PR checks parsing the specs.
@@ -327,6 +329,9 @@ find %{buildroot} -type f -name "*.la" -delete -print
327329
%do_files aarch64-linux-gnu %{build_aarch64}
328330

329331
%changelog
332+
* Wed May 28 2025 Akarsh Chaudhary <v-akarshc@microsoft.com> - 2.41-6
333+
- Patch CVE-2025-5245 , CVE-2025-5244
334+
330335
* Tue Mar 11 2025 Kavya Sree Kaitepalli <kkaitepalli@microsoft.com> - 2.41-5
331336
- Fix CVE-2025-1744
332337

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ zlib-devel-1.3.1-1.azl3.aarch64.rpm
1313
file-5.45-1.azl3.aarch64.rpm
1414
file-devel-5.45-1.azl3.aarch64.rpm
1515
file-libs-5.45-1.azl3.aarch64.rpm
16-
binutils-2.41-5.azl3.aarch64.rpm
17-
binutils-devel-2.41-5.azl3.aarch64.rpm
16+
binutils-2.41-6.azl3.aarch64.rpm
17+
binutils-devel-2.41-6.azl3.aarch64.rpm
1818
gmp-6.3.0-1.azl3.aarch64.rpm
1919
gmp-devel-6.3.0-1.azl3.aarch64.rpm
2020
mpfr-4.2.1-1.azl3.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ zlib-devel-1.3.1-1.azl3.x86_64.rpm
1313
file-5.45-1.azl3.x86_64.rpm
1414
file-devel-5.45-1.azl3.x86_64.rpm
1515
file-libs-5.45-1.azl3.x86_64.rpm
16-
binutils-2.41-5.azl3.x86_64.rpm
17-
binutils-devel-2.41-5.azl3.x86_64.rpm
16+
binutils-2.41-6.azl3.x86_64.rpm
17+
binutils-devel-2.41-6.azl3.x86_64.rpm
1818
gmp-6.3.0-1.azl3.x86_64.rpm
1919
gmp-devel-6.3.0-1.azl3.x86_64.rpm
2020
mpfr-4.2.1-1.azl3.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ bash-5.2.15-3.azl3.aarch64.rpm
3030
bash-debuginfo-5.2.15-3.azl3.aarch64.rpm
3131
bash-devel-5.2.15-3.azl3.aarch64.rpm
3232
bash-lang-5.2.15-3.azl3.aarch64.rpm
33-
binutils-2.41-5.azl3.aarch64.rpm
34-
binutils-debuginfo-2.41-5.azl3.aarch64.rpm
35-
binutils-devel-2.41-5.azl3.aarch64.rpm
33+
binutils-2.41-6.azl3.aarch64.rpm
34+
binutils-debuginfo-2.41-6.azl3.aarch64.rpm
35+
binutils-devel-2.41-6.azl3.aarch64.rpm
3636
bison-3.8.2-1.azl3.aarch64.rpm
3737
bison-debuginfo-3.8.2-1.azl3.aarch64.rpm
3838
bzip2-1.0.8-1.azl3.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ bash-5.2.15-3.azl3.x86_64.rpm
3232
bash-debuginfo-5.2.15-3.azl3.x86_64.rpm
3333
bash-devel-5.2.15-3.azl3.x86_64.rpm
3434
bash-lang-5.2.15-3.azl3.x86_64.rpm
35-
binutils-2.41-5.azl3.x86_64.rpm
36-
binutils-aarch64-linux-gnu-2.41-5.azl3.x86_64.rpm
37-
binutils-debuginfo-2.41-5.azl3.x86_64.rpm
38-
binutils-devel-2.41-5.azl3.x86_64.rpm
35+
binutils-2.41-6.azl3.x86_64.rpm
36+
binutils-aarch64-linux-gnu-2.41-6.azl3.x86_64.rpm
37+
binutils-debuginfo-2.41-6.azl3.x86_64.rpm
38+
binutils-devel-2.41-6.azl3.x86_64.rpm
3939
bison-3.8.2-1.azl3.x86_64.rpm
4040
bison-debuginfo-3.8.2-1.azl3.x86_64.rpm
4141
bzip2-1.0.8-1.azl3.x86_64.rpm
@@ -70,7 +70,7 @@ cracklib-lang-2.9.11-1.azl3.x86_64.rpm
7070
createrepo_c-1.0.3-1.azl3.x86_64.rpm
7171
createrepo_c-debuginfo-1.0.3-1.azl3.x86_64.rpm
7272
createrepo_c-devel-1.0.3-1.azl3.x86_64.rpm
73-
cross-binutils-common-2.41-5.azl3.noarch.rpm
73+
cross-binutils-common-2.41-6.azl3.noarch.rpm
7474
cross-gcc-common-13.2.0-7.azl3.noarch.rpm
7575
curl-8.11.1-3.azl3.x86_64.rpm
7676
curl-debuginfo-8.11.1-3.azl3.x86_64.rpm

0 commit comments

Comments
 (0)